roc/test/snapshots
2025-12-21 11:48:09 -05:00
..
comprehensive Update snapshots for nominal pattern bound variable fix 2025-12-16 07:55:22 -05:00
eval Convert fx test to eval snapshot test for issue #8689 2025-12-16 12:14:25 -05:00
expr Fix tests 2025-12-14 13:32:20 +00:00
file Add doc comment and update snapshots for parser changes 2025-12-09 22:34:16 -05:00
formatting Add for clauses to platform modules 2025-12-12 21:21:51 -05:00
fuzz_crash Merge remote-tracking branch 'remote/main' into implement-box 2025-12-15 20:01:23 +11:00
if_then_else fix if else fmt without {} (#8698) 2025-12-17 16:36:17 +01:00
issue Remove inspect keyword and use Str.inspect instead 2025-12-09 20:43:26 -05:00
lambda_capture
match_expr Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
nominal Merge pull request #8669 from roc-lang/fix-issue-8666 2025-12-16 21:24:55 -05:00
numeric_edge_cases
pass Fix various things 2025-12-04 12:10:56 -05:00
platform Update snapshots 2025-12-18 12:42:33 -05:00
plume_package Add try.map_ok and try.map_err 2025-12-21 11:48:09 -05:00
primitive Add doc comment and update snapshots for parser changes 2025-12-09 22:34:16 -05:00
records Add doc comment and update snapshots for parser changes 2025-12-09 22:34:16 -05:00
repl Improve render helper to render lists of tags correctly (#8702) 2025-12-19 10:32:33 +01:00
some_folder
statement
static_dispatch Update snapshots for nominal pattern bound variable fix 2025-12-16 07:55:22 -05:00
todo_cross_module_calls
type_checking
type_module
where_clause Merge origin/main into fix-another-aoc 2025-12-11 23:18:39 -05:00
001.md
add_var_with_spaces.md
annotations.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
app_header__nonempty_multiline.md
app_header__nonempty_multiline__commented.md
app_header__nonempty_multiline__trailing_comma.md
app_header__platform_not_first.md
app_header_nonempty_singleline.md
arrow_qualified_functions.md Fix tag union printing syntax 2025-12-01 22:52:21 -05:00
binop_omnibus__single__no_spaces.md Fix tests 2025-12-14 13:32:20 +00:00
binop_omnibus__singleline.md Fix tests 2025-12-14 13:32:20 +00:00
binops.md Fix tests 2025-12-14 13:32:20 +00:00
bool_closure_type_check.md
bool_equality.md
bound_type_var_no_annotation.md
box_advanced.md improve Box snapshots 2025-12-12 08:18:36 +11:00
box_in_containers.md improve Box snapshots 2025-12-12 08:18:36 +11:00
box_round_trips.md improve Box snapshots 2025-12-12 08:18:36 +11:00
can_basic_scoping.md
can_closure_captures.md Fix some canonicalization import issues 2025-12-09 22:05:46 -05:00
can_dot_access.md
can_dot_access_with_vars.md
can_frac_literal.md
can_hex_integer.md
can_import_aliased_conflicts.md Fix some canonicalization import issues 2025-12-09 22:05:46 -05:00
can_import_comprehensive.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
can_import_exposing_conflicts.md Fix some canonicalization import issues 2025-12-09 22:05:46 -05:00
can_import_exposing_types.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
can_import_json.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
can_import_module_not_found.md Fix some canonicalization import issues 2025-12-09 22:05:46 -05:00
can_import_nested_modules.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
can_import_type_alias_conflict.md Fix some canonicalization import issues 2025-12-09 22:05:46 -05:00
can_import_type_annotations.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
can_import_unresolved_qualified.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
can_import_with_alias.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
can_list_first_concrete.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_list_heterogeneous.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_list_mismatch_then_nested_error.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_list_multiline_mismatch.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_list_nested_heterogeneous.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_list_number_doesnt_fit.md
can_list_rest_types.md
can_list_triple_nested_heterogeneous.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_list_two_elements.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_nested_heterogeneous_lists.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
can_two_decls.md
can_var_scoping_invalid_top_level.md
can_var_scoping_regular_var.md
can_var_scoping_var_idents.md
can_var_scoping_var_redeclaration.md
crash_and_ellipsis_test.md
def_simple_with_annotation.md
default_app_no_main.md
default_app_wrong_arity.md
effectful_with_effectful_annotation.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
exposed_items_test.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
expr_ident_simple.md
expr_if_missing_else.md
expr_int_invalid.md
expr_int_negative.md
expr_int_simple.md
expr_no_space_dot_int.md
external_decl_lookup.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
external_lookup_expr.md
fib_module.md
file_multiple_type_decls.md
function_no_annotation.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
header_expected_open_bracket.md
hello_world.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
hello_world.roc
hello_world_with_block.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
import_exposing_basic.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
lambda_annotation_mismatch_error.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
lambda_currying_constraint.md
lambda_in_collection.md
lambda_multi_arg_mismatch.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
lambda_parameter_unused.md
lambda_ret_constraint_bug.md
let_polymorphism_complex.md Fix polymorphic numeric let-generalization (issue #8666) 2025-12-14 22:38:11 -05:00
let_polymorphism_error.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
let_polymorphism_expr.md
let_polymorphism_lists.md
let_polymorphism_numbers.md
let_polymorphism_records.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
list_map.md Add list.map snapshot and use mutable var in impl 2025-12-21 11:48:09 -05:00
module_empty.md
module_multiline_with_comments.md Add doc comment and update snapshots for parser changes 2025-12-09 22:34:16 -05:00
module_nonempty_single.md
module_singleline_fmts_to_multiline.md
multi_qualified_import.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
multiline_binop_1.md
multiline_list_formatting_5.md
multiline_list_formatting_7.md
multiline_list_formatting_11.md
multiline_list_formatting_14.md
multiline_string_complex.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
multiline_string_expr.md
nominal_type_origin_mismatch.md
numbers.md
numeric_let_generalize_in_block.md Fix polymorphic numeric let-generalization (issue #8666) 2025-12-14 22:38:11 -05:00
package_empty.md
package_header_nonempty_multiline_1.md
package_header_nonempty_multiline_3.md
package_header_nonempty_multiline_4.md
package_header_nonempty_multiline_6.md
package_header_nonempty_singleline_1.md
pattern_f64_overflow.md
pure_annotation_effectful_body_error.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
pure_with_pure_annotation.md
qualified_tag.md
qualified_type_canonicalization.md Add doc comment and update snapshots for parser changes 2025-12-09 22:34:16 -05:00
qualified_with_anno.md
README.md
record_access_multiline_formatting_1.md
record_access_multiline_formatting_4.md
rigid_var_instantiation.md
rigid_var_no_instantiation_error.md
simple_external_lookup.md
simple_lambda_constraint_success.md
simple_module_no_blanks.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
statement_annotations.md
static_dispatch_super_test.md
string.md
string_interpolation_type_mismatch.md
string_multiline_formatting_(due_to_templating_not_multiline_string_literal)_1.md
string_multiline_formatting_(due_to_templating_not_multiline_string_literal)_3.md
string_unicode_emoji.md
syntax_grab_bag.md Fix tests 2025-12-14 13:32:20 +00:00
test_exact_pattern_crash.md Merge origin/main into fix-another-aoc 2025-12-11 23:18:39 -05:00
test_headerless_main.md
test_instantiated_arg_mismatch.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
test_instantiated_return_crash.md
test_instantiation_arity_mismatch.md Merge origin/main into fix-another-aoc 2025-12-11 23:18:39 -05:00
test_nested_instantiation_crash.md
test_tuple_instantiation_crash.md Merge origin/main into fix-another-aoc 2025-12-11 23:18:39 -05:00
try_err_or_lookup.md
try_map_err.md Add try.map_ok and try.map_err 2025-12-21 11:48:09 -05:00
try_map_ok.md Add try.map_ok and try.map_err 2025-12-21 11:48:09 -05:00
try_ok_or_lookup.md
type_alias_decl.md
type_alias_parameterized.md Merge origin/main into fix-another-aoc 2025-12-11 23:18:39 -05:00
type_alias_simple.md
type_alias_tag_union.md
type_anno_connection.md
type_annotation_basic.md
type_annotation_missing_parens.md Add doc comment and update snapshots for parser changes 2025-12-09 22:34:16 -05:00
type_annotations.md
type_app_complex_nested.md Pluralize arity more nicely 2025-12-02 01:14:11 -05:00
type_app_multiple_args.md Pluralize arity more nicely 2025-12-02 01:14:11 -05:00
type_app_nested.md
type_app_single_arg.md
type_app_with_vars.md Merge origin/main into fix-another-aoc 2025-12-11 23:18:39 -05:00
type_application_basic.md
type_builtin.md
type_comprehensive_scope.md Pluralize arity more nicely 2025-12-02 01:14:11 -05:00
type_declarations.md
type_function_basic.md
type_function_effectful.md
type_function_multi_arg.md
type_function_simple.md
type_higher_order_multiple_vars.md
type_local_declarations.md Fix some canonicalization import issues 2025-12-09 22:05:46 -05:00
type_local_scope_vars.md Move rank check to before annotation generation 2025-12-20 17:13:06 -05:00
type_multiple_aliases.md
type_record_basic.md Fix some type writing bugs 2025-12-02 01:06:06 -05:00
type_record_effectful.md Fix tests, update snapshots 2025-12-03 23:02:46 -05:00
type_record_simple.md
type_record_with_vars.md
type_redeclaration_same_scope.md
type_same_var_multiple_uses.md
type_scope_integration.md
type_shadowing_across_scopes.md
type_simple_pure.md
type_simple_type_var.md
type_tag_union_basic.md Fix tag union printing syntax 2025-12-01 22:52:21 -05:00
type_tag_union_complex.md
type_two_variables.md
type_undeclared_usage.md
type_var_alias_static_dispatch.md Merge origin/main into fix-another-aoc 2025-12-11 23:18:39 -05:00
type_var_annotation_body_connection.md
type_var_basic.md
type_var_collision_simple.md
type_var_mismatch.md Error if using nominal types outside origin module 2025-12-03 17:10:22 -05:00
type_var_multiple.md
type_var_name_avoids_collision.md Fix tag union printing syntax 2025-12-01 22:52:21 -05:00
type_var_namespace.md
type_var_nested.md Update snapshots 2025-12-02 20:36:59 -05:00
type_var_shadowing.md
type_var_shadowing_inner.md
type_var_underscore_conventions.md
unary_minus_double_negative.md
unary_minus_lambda_parameter.md
unicode_single_quotes.md
unused_vars_block.md
unused_vars_simple.md
utf8_problem_importable.md

Snapshots

Snapshot tests that validate compiler behavior by capturing the output of each compilation stage for specific Roc code examples.

Snapshot tests provide comprehensive validation of the compilation pipeline by showing how source code is transformed through each stage: tokenization, parsing, canonicalization, and type checking etc.

Each snapshot file contains the expected output and helps us to detect regressions when compiler behavior changes unexpectedly.

Usage

  • Generate all snapshots: zig build snapshot
  • Update specific snapshot: zig build snapshot -- <file_path>
  • Update expected from problems: zig build update-expected -- <file_path>
  • Debug REPL evaluation with trace: zig build snapshot -- <repl_snapshot.md> --trace-eval

Trace Debugging

The --trace-eval flag enables detailed interpreter tracing for debugging REPL snapshots:

# Debug build (trace support enabled by default)
zig build snapshot -- src/snapshots/repl/repl_record_field_access.md --trace-eval

Requirements:

  • Only works with REPL snapshots (type=repl)
  • Can only be used with a single snapshot file
  • Trace output is automatically enabled in debug builds
  • For release builds, use -Dtrace-eval=true to enable tracing