The evaluator test suite covers every built-in macro, the Rhai and Python scripting back-ends, the output-sink tracing infrastructure, and the public eval API. Tests live under src/evaluator/tests/ and are gated by #[cfg(test)] in mod.rs.

Focused test pages

Test organisation

Module Coverage

test_utils

Shared helpers: config_in_temp_dir, evaluator_in_temp_dir

test_macros

%def basic call, parameters, nested, scope isolation

test_def

%def error paths: missing args, numeric names, duplicate params, =-style params

test_var

Variable substitution through %def parameter binding

test_set

%set builtin: sets a variable in the current scope

test_if

%if conditionals: truthy/falsy strings, nested, macro conditions

test_equal

%equal: exact-match comparison, whitespace sensitivity

test_include

%include: basic, macros, missing file, circular detection, symlinks, scope, open_includes cleanup on error (regression for bug #6)

test_import

%import: definitions-only include; text output discarded

test_export

%export: frozen arguments, wrong-arity error

test_eval

%eval: dynamic macro dispatch by name, nested macros, empty args

test_here

%here: source-file patching via modify_source

test_case_conversion

Case enum, convert_case, convert_case_str: all nine styles, delimiters, numbers, acronyms, SCREAMING-KEBAB edge cases

test_case_modifiers

%capitalize, %decapitalize, %convert_case, %to_snake_case, %to_camel_case, %to_pascal_case, %to_screaming_case

test_rhaidef

%rhaidef arithmetic, helper functions, scope capture, hex, error propagation; %rhaiset/%rhaiget/%rhaiexpr store operations including writeback, integer type preservation, array/map accumulation

test_pydef

%pydef arithmetic, multi-param, greet, error propagation; %pyset/%pyget store operations, param shadowing store key

test_output

PlainOutput parity with evaluate(); SpyOutput (test-only sink); TracingOutput per-line spans; into_macro_map_entries

test_eval_api

eval_string_with_defaults, eval_file_with_config, eval_files_with_config: basic, include, error, nested macros, special char, shared macros

test_macro_api

process_string, process_file, process_files_from_config at the macro_api layer

test_skill_examples

Exact examples from SKILL.md: positional/named params, arity edge cases, dynamic vs lexical scoping, %export freeze

File structure

// <<@file weaveback-macro/src/evaluator/tests/mod.rs>>=
// <<tests mod>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_utils.rs>>=
// <<test utils>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_macros.rs>>=
// <<test macros>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_def.rs>>=
// <<test def>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_var.rs>>=
// <<test var>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_set.rs>>=
// <<test set>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_if.rs>>=
// <<test if>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_equal.rs>>=
// <<test equal>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_include.rs>>=
// <<test include>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_import.rs>>=
// <<test import>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_export.rs>>=
// <<test export>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_eval.rs>>=
// <<test eval>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_here.rs>>=
// <<test here>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_case_conversion.rs>>=
// <<test case conversion>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_case_modifiers.rs>>=
// <<test case modifiers>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_rhaidef.rs>>=
// <<test rhaidef>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_pydef.rs>>=
// <<test pydef>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_output.rs>>=
// <<test output>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_eval_api.rs>>=
// <<test eval api>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_macro_api.rs>>=
// <<test macro api>>
// @

// <<@file weaveback-macro/src/evaluator/tests/test_skill_examples.rs>>=
// <<test skill examples>>
// @

tests/mod.rs — module registry

// <<tests mod>>=
// crates/weaveback-macro/src/evaluator/tests/mod.rs
mod test_case_conversion;
mod test_case_modifiers;
mod test_def;
mod test_equal;
mod test_eval;
mod test_export;
mod test_here;
mod test_if;
mod test_import;
mod test_include;
mod test_macro_api;
mod test_macros;
mod test_pydef;
mod test_rhaidef;
mod test_set;
mod test_skill_examples;
mod test_utils;
mod test_var;
mod test_output;
// @