Skip to main content

enrich_query_test.go

enrich_query_test.go - Overview

This file contains unit tests for the functions in enrich_query.go. It tests whether enrichment is correctly determined and if parameters are correctly enriched.

Detailed Documentation

TestEnrichmentRquired(t *testing.T)

  • Purpose: Tests the EnrichmentRequired function to ensure it correctly determines whether enrichment is required for a query.
  • Parameters:
    • t: *testing.T - Testing object for running test cases.
  • Returns: None

TestEnrichParams(t *testing.T)

  • Purpose: Tests the Enrich function to ensure it correctly enriches query parameters with metadata.
  • Parameters:
    • t: *testing.T - Testing object for running test cases.
  • Returns: None

TestJsonEnrich(t *testing.T)

  • Purpose: Tests the jsonFilterEnrich function to ensure it correctly enriches JSON filter items by determining their data types.
  • Parameters:
    • t: *testing.T - Testing object for running test cases.
  • Returns: None

TestJsonReplaceField(t *testing.T)

  • Purpose: Tests the jsonReplaceField function to ensure it correctly replaces fields in JSON filter items with their corresponding metadata.
  • Parameters:
    • t: *testing.T - Testing object for running test cases.
  • Returns: None

TestParseStrValue(t *testing.T)

  • Purpose: Tests the parseStrValue function to ensure it correctly parses string values and determines their data types.
  • Parameters:
    • t: *testing.T - Testing object for running test cases.
  • Returns: None

Code Examples

N/A

Include in Getting Started: NO