roc/test/snapshots
2025-09-26 20:54:43 -04:00
..
eval run snapshot tool 2025-08-26 22:18:03 +02:00
expr Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
file Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
formatting Roc platform host shim (#8214) 2025-09-09 13:15:23 +02:00
fuzz_crash Roc platform host shim (#8214) 2025-09-09 13:15:23 +02:00
if_then_else Implement type unification for equality/comparison in binary operations 2025-09-01 21:09:28 +02:00
issue run snapshot tool 2025-08-26 22:18:03 +02:00
lambda_capture run snapshot tool 2025-08-26 22:18:03 +02:00
match_expr Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
nominal Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
numeric_edge_cases run snapshot tool 2025-08-26 22:18:03 +02:00
pass Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
platform Roc platform host shim (#8214) 2025-09-09 13:15:23 +02:00
plume_package run snapshot tool 2025-08-26 22:18:03 +02:00
primitive Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
records Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
repl Convert everything over to use new interpreter 2025-09-26 20:54:43 -04:00
some_folder run snapshot tool 2025-08-26 22:18:03 +02:00
statement Add missing unification branch 2025-09-01 21:09:33 +02:00
type_checking run snapshot tool 2025-08-26 22:18:03 +02:00
where_clause Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
001.md run snapshot tool 2025-08-26 22:18:03 +02:00
add_var_with_spaces.md run snapshot tool 2025-08-26 22:18:03 +02:00
annotations.md run snapshot tool 2025-08-26 22:18:03 +02:00
app_header__nonempty_multiline.md run snapshot tool 2025-08-26 22:18:03 +02:00
app_header__nonempty_multiline__commented.md run snapshot tool 2025-08-26 22:18:03 +02:00
app_header__nonempty_multiline__trailing_comma.md run snapshot tool 2025-08-26 22:18:03 +02:00
app_header__platform_not_first.md run snapshot tool 2025-08-26 22:18:03 +02:00
app_header_nonempty_singleline.md run snapshot tool 2025-08-26 22:18:03 +02:00
binop_omnibus__single__no_spaces.md run snapshot tool 2025-08-26 22:18:03 +02:00
binop_omnibus__singleline.md run snapshot tool 2025-08-26 22:18:03 +02:00
binops.md run snapshot tool 2025-08-26 22:18:03 +02:00
bool_closure_type_check.md run snapshot tool 2025-08-26 22:18:03 +02:00
bound_type_var_no_annotation.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_basic_scoping.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_dot_access.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_dot_access_with_vars.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_frac_literal.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_hex_integer.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_import_comprehensive.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_import_exposing_types.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_import_json.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_import_nested_modules.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
can_import_type_annotations.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_import_unresolved_qualified.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_import_with_alias.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_first_concrete.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_heterogeneous.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_mismatch_then_nested_error.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_multiline_mismatch.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_nested_heterogeneous.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_number_doesnt_fit.md Add missing unification branch 2025-09-01 21:09:33 +02:00
can_list_rest_types.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_triple_nested_heterogeneous.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_list_two_elements.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_nested_heterogeneous_lists.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_two_decls.md Roc platform host shim (#8214) 2025-09-09 13:15:23 +02:00
can_var_scoping_invalid_top_level.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
can_var_scoping_regular_var.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_var_scoping_var_idents.md run snapshot tool 2025-08-26 22:18:03 +02:00
can_var_scoping_var_redeclaration.md run snapshot tool 2025-08-26 22:18:03 +02:00
crash_and_ellipsis_test.md run snapshot tool 2025-08-26 22:18:03 +02:00
def_simple_with_annotation.md run snapshot tool 2025-08-26 22:18:03 +02:00
effectful_with_effectful_annotation.md run snapshot tool 2025-08-26 22:18:03 +02:00
exposed_items_test.md run snapshot tool 2025-08-26 22:18:03 +02:00
expr_ident_simple.md run snapshot tool 2025-08-26 22:18:03 +02:00
expr_if_missing_else.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
expr_int_invalid.md run snapshot tool 2025-08-26 22:18:03 +02:00
expr_int_negative.md run snapshot tool 2025-08-26 22:18:03 +02:00
expr_int_simple.md run snapshot tool 2025-08-26 22:18:03 +02:00
expr_no_space_dot_int.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
external_decl_lookup.md run snapshot tool 2025-08-26 22:18:03 +02:00
external_lookup_expr.md run snapshot tool 2025-08-26 22:18:03 +02:00
fib_module.md run snapshot tool 2025-08-26 22:18:03 +02:00
file_multiple_type_decls.md run snapshot tool 2025-08-26 22:18:03 +02:00
function_no_annotation.md run snapshot tool 2025-08-26 22:18:03 +02:00
header_expected_open_bracket.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
hello_world.md run snapshot tool 2025-08-26 22:18:03 +02:00
hello_world.roc
hello_world_with_block.md run snapshot tool 2025-08-26 22:18:03 +02:00
import_exposing_alias.md run snapshot tool 2025-08-26 22:18:03 +02:00
import_exposing_basic.md run snapshot tool 2025-08-26 22:18:03 +02:00
lambda_annotation_mismatch_error.md run snapshot tool 2025-08-26 22:18:03 +02:00
lambda_currying_constraint.md run snapshot tool 2025-08-26 22:18:03 +02:00
lambda_in_collection.md run snapshot tool 2025-08-26 22:18:03 +02:00
lambda_multi_arg_mismatch.md run snapshot tool 2025-08-26 22:18:03 +02:00
lambda_parameter_unused.md run snapshot tool 2025-08-26 22:18:03 +02:00
lambda_ret_constraint_bug.md run snapshot tool 2025-08-26 22:18:03 +02:00
let_polymorphism_complex.md run snapshot tool 2025-08-26 22:18:03 +02:00
let_polymorphism_error.md run snapshot tool 2025-08-26 22:18:03 +02:00
let_polymorphism_expr.md run snapshot tool 2025-08-26 22:18:03 +02:00
let_polymorphism_lists.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
let_polymorphism_numbers.md run snapshot tool 2025-08-26 22:18:03 +02:00
let_polymorphism_records.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
module_empty.md run snapshot tool 2025-08-26 22:18:03 +02:00
module_multiline_with_comments.md run snapshot tool 2025-08-26 22:18:03 +02:00
module_nonempty_single.md run snapshot tool 2025-08-26 22:18:03 +02:00
module_singleline_fmts_to_multiline.md run snapshot tool 2025-08-26 22:18:03 +02:00
multi_qualified_import.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
multiline_binop_1.md run snapshot tool 2025-08-26 22:18:03 +02:00
multiline_list_formatting_5.md run snapshot tool 2025-08-26 22:18:03 +02:00
multiline_list_formatting_7.md run snapshot tool 2025-08-26 22:18:03 +02:00
multiline_list_formatting_11.md run snapshot tool 2025-08-26 22:18:03 +02:00
multiline_list_formatting_14.md run snapshot tool 2025-08-26 22:18:03 +02:00
multiline_string_complex.md run snapshot tool 2025-08-26 22:18:03 +02:00
multiline_string_expr.md run snapshot tool 2025-08-26 22:18:03 +02:00
nested_ifs.md remove CAN and TYPES from REPL snapshots 2025-08-15 11:27:44 +10:00
nominal_type_origin_mismatch.md run snapshot tool 2025-08-26 22:18:03 +02:00
numbers.md run snapshot tool 2025-08-26 22:18:03 +02:00
package_empty.md run snapshot tool 2025-08-26 22:18:03 +02:00
package_header_nonempty_multiline_1.md run snapshot tool 2025-08-26 22:18:03 +02:00
package_header_nonempty_multiline_3.md run snapshot tool 2025-08-26 22:18:03 +02:00
package_header_nonempty_multiline_4.md run snapshot tool 2025-08-26 22:18:03 +02:00
package_header_nonempty_multiline_6.md run snapshot tool 2025-08-26 22:18:03 +02:00
package_header_nonempty_singleline_1.md run snapshot tool 2025-08-26 22:18:03 +02:00
pattern_f64_overflow.md run snapshot tool 2025-08-26 22:18:03 +02:00
pure_annotation_effectful_body_error.md run snapshot tool 2025-08-26 22:18:03 +02:00
pure_with_pure_annotation.md run snapshot tool 2025-08-26 22:18:03 +02:00
qualified_tag.md run snapshot tool 2025-08-26 22:18:03 +02:00
qualified_type_canonicalization.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
qualified_with_anno.md run snapshot tool 2025-08-26 22:18:03 +02:00
README.md
record_access_multiline_formatting_1.md run snapshot tool 2025-08-26 22:18:03 +02:00
record_access_multiline_formatting_4.md run snapshot tool 2025-08-26 22:18:03 +02:00
rigid_var_instantiation.md run snapshot tool 2025-08-26 22:18:03 +02:00
rigid_var_no_instantiation_error.md run snapshot tool 2025-08-26 22:18:03 +02:00
simple_external_lookup.md run snapshot tool 2025-08-26 22:18:03 +02:00
simple_lambda_constraint_success.md run snapshot tool 2025-08-26 22:18:03 +02:00
simple_module_no_blanks.md run snapshot tool 2025-08-26 22:18:03 +02:00
statement_annotations.md run snapshot tool 2025-08-26 22:18:03 +02:00
static_dispatch_super_test.md run snapshot tool 2025-08-26 22:18:03 +02:00
string.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
string_multiline_formatting_(due_to_templating_not_multiline_string_literal)_1.md run snapshot tool 2025-08-26 22:18:03 +02:00
string_multiline_formatting_(due_to_templating_not_multiline_string_literal)_3.md run snapshot tool 2025-08-26 22:18:03 +02:00
string_unicode_emoji.md run snapshot tool 2025-08-26 22:18:03 +02:00
syntax_grab_bag.md run snapshot tool 2025-08-26 22:18:03 +02:00
test_exact_pattern_crash.md run snapshot tool 2025-08-26 22:18:03 +02:00
test_instantiated_arg_mismatch.md run snapshot tool 2025-08-26 22:18:03 +02:00
test_instantiated_return_crash.md run snapshot tool 2025-08-26 22:18:03 +02:00
test_instantiation_arity_mismatch.md run snapshot tool 2025-08-26 22:18:03 +02:00
test_nested_instantiation_crash.md Roc platform host shim (#8214) 2025-09-09 13:15:23 +02:00
test_tuple_instantiation_crash.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_alias_decl.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_alias_parameterized.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_alias_simple.md Add missing unification branch 2025-09-01 21:09:33 +02:00
type_alias_tag_union.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_anno_connection.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_annotation_basic.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_annotation_missing_parens.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_annotations.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_app_complex_nested.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_app_multiple_args.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_app_nested.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_app_single_arg.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_app_with_vars.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_application_basic.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_builtin.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_comprehensive_scope.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_declarations.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_function_basic.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_function_effectful.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_function_multi_arg.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_function_simple.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_higher_order_multiple_vars.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_local_scope_vars.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_multiple_aliases.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_record_basic.md Add missing unification branch 2025-09-01 21:09:33 +02:00
type_record_effectful.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_record_simple.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_record_with_vars.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_redeclaration_same_scope.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_same_var_multiple_uses.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_scope_integration.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_shadowing_across_scopes.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_simple_pure.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_simple_type_var.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_tag_union_basic.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_tag_union_complex.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_two_variables.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_undeclared_usage.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_annotation_body_connection.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_basic.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_collision_simple.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_multiple.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_name_avoids_collision.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_namespace.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
type_var_nested.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_shadowing.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_shadowing_inner.md run snapshot tool 2025-08-26 22:18:03 +02:00
type_var_underscore_conventions.md run snapshot tool 2025-08-26 22:18:03 +02:00
unary_minus_double_negative.md run snapshot tool 2025-08-26 22:18:03 +02:00
unary_minus_lambda_parameter.md run snapshot tool 2025-08-26 22:18:03 +02:00
unicode_single_quotes.md Revert "Don't try to format malformed snapshots" 2025-08-29 12:44:22 +10:00
unused_vars_block.md run snapshot tool 2025-08-26 22:18:03 +02:00
unused_vars_simple.md run snapshot tool 2025-08-26 22:18:03 +02:00

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