Skip to content

Test Suite Guide

The CCL Test Suite provides 447 assertions across 205 tests for validating CCL implementations.

Implementers use the flat format in generated_tests/ - one test per validation function with typed fields for filtering.

Each test includes:

  • validation: Function being tested (parse, build_hierarchy, etc.)
  • functions: Array of required CCL functions
  • features: Array of optional language features
  • behaviors: Array of implementation behavior choices
  • expected: Expected result with count field for assertion verification
  • input: CCL text to parse

Functions - CCL functions by category:

  • Core: parse, build_hierarchy
  • Typed Access: get_string, get_int, get_bool, get_float, get_list
  • Processing: filter, compose, expand_dotted
  • Formatting: print, canonical_format, round_trip
  • Algebraic Properties: compose_associative, identity_left, identity_right

Features - Optional language features:

  • comments, experimental_dotted_keys, empty_keys, multiline, unicode, whitespace

Behaviors - Implementation choices (exclusivity defined per-test via conflicts field):

Behavior GroupOptionsDescription
Continuation Baselinetoplevel_indent_strip vs toplevel_indent_preserveTop-level N=0 (reference) vs N=first key’s indent (simpler)
Line Endingscrlf_preserve_literal vs crlf_normalize_to_lfCRLF handling: preserve \r chars vs normalize to LF
Boolean Parsingboolean_lenient vs boolean_strictAccept “yes”/“no” vs only “true”/“false”
Tab Handlingtabs_as_content vs tabs_as_whitespacePreserve tabs literally vs treat as whitespace
Indentationindent_spaces vs indent_tabsOutput formatting style
List Accesslist_coercion_enabled vs list_coercion_disabledList access coercion behavior
Array Orderingarray_order_insertion vs array_order_lexicographicPreserve insertion order vs sort lexicographically

See the Behavior Reference for detailed documentation of each behavior.

parse - Filter tests:

tests.filter(t => t.validation === 'parse')

build_hierarchy - Filter tests:

tests.filter(t => t.validation === 'build_hierarchy')

get_string, get_int, get_bool, get_float, get_list - Filter tests:

tests.filter(t => t.validation.startsWith('get_'))

print, round_trip - Filter tests:

tests.filter(t => t.validation === 'print' || t.validation === 'round_trip')

The print function verifies structure-preserving output. For inputs in standard format (single space around =, 2-space indentation), print(parse(x)) == x.

compose_associative, identity_left, identity_right - These tests use multiple inputs to verify monoid properties:

tests.filter(t => ['compose_associative', 'identity_left', 'identity_right'].includes(t.validation))

Filter by supported features (comments, experimental_dotted_keys, etc.):

tests.filter(t => t.features.every(f => supportedFeatures.includes(f)))

Filter tests by implementation capabilities:

const supportedTests = tests.filter(test => {
// Check functions
if (!test.functions.every(f => implementedFunctions.includes(f))) return false;
// Check features
if (!test.features.every(f => supportedFeatures.includes(f))) return false;
// Check behavior conflicts
if (test.conflicts?.behaviors?.some(b => chosenBehaviors.includes(b))) return false;
return true;
});
{
"name": "basic_key_value_pairs_parse",
"validation": "parse",
"input": "name = Alice\nage = 42",
"expected": {
"count": 2,
"entries": [
{"key": "name", "value": "Alice"},
{"key": "age", "value": "42"}
]
},
"functions": ["parse"],
"features": [],
"behaviors": []
}

See CCL Test Suite repository for complete test runner and JSON schema.