From 137d2cdcab8f73172ee1214d91ca2c12c50b04ed Mon Sep 17 00:00:00 2001 From: Dominik Nakamura Date: Sun, 29 Oct 2023 17:58:37 +0900 Subject: [PATCH] refactor: add schema as snapshot description Include the source schema into snapshots for easier verification as this displays the schema together with the output of each snapshot in review mode. --- crates/stef-build/tests/compiler.rs | 16 ++++++++-- .../compiler__compile@alias_basic.stef.snap | 2 +- ...ompiler__compile@attribute_multi.stef.snap | 2 +- ...mpiler__compile@attribute_single.stef.snap | 2 +- ...compiler__compile@attribute_unit.stef.snap | 2 +- .../compiler__compile@attributes.stef.snap | 2 +- ...piler__compile@attributes_min_ws.stef.snap | 2 +- .../compiler__compile@const_basic.stef.snap | 2 +- .../compiler__compile@const_string.stef.snap | 2 +- .../compiler__compile@enum_basic.stef.snap | 2 +- .../compiler__compile@enum_generics.stef.snap | 2 +- .../compiler__compile@enum_many_ws.stef.snap | 2 +- .../compiler__compile@enum_min_ws.stef.snap | 2 +- .../compiler__compile@import_basic.stef.snap | 2 +- .../compiler__compile@module_basic.stef.snap | 2 +- .../compiler__compile@schema_basic.stef.snap | 2 +- .../compiler__compile@struct_basic.stef.snap | 2 +- ...ompiler__compile@struct_generics.stef.snap | 2 +- ...compiler__compile@struct_many_ws.stef.snap | 2 +- .../compiler__compile@struct_min_ws.stef.snap | 2 +- .../compiler__compile@struct_tuple.stef.snap | 2 +- .../compiler__compile@types_basic.stef.snap | 2 +- .../compiler__compile@types_generic.stef.snap | 2 +- .../compiler__compile@types_nested.stef.snap | 2 +- ...compiler__compile@types_non_zero.stef.snap | 2 +- .../compiler__compile@types_ref.stef.snap | 2 +- .../compiler__compile_extra@alias.stef.snap | 2 +- .../compiler__compile_extra@const.stef.snap | 2 +- .../compiler__compile_extra@enum.stef.snap | 2 +- .../compiler__compile_extra@import.stef.snap | 2 +- .../compiler__compile_extra@module.stef.snap | 2 +- .../compiler__compile_extra@struct.stef.snap | 2 +- crates/stef-compiler/tests/compiler.rs | 15 +++++----- .../compiler__error@enum_gen_dup.stef.snap | 2 +- .../compiler__error@enum_gen_unused.stef.snap | 2 +- ...ompiler__error@enum_named_dup_id.stef.snap | 2 +- ...piler__error@enum_named_dup_name.stef.snap | 2 +- ...piler__error@enum_unnamed_dup_id.stef.snap | 2 +- ...piler__error@enum_variant_dup_id.stef.snap | 2 +- ...ler__error@enum_variant_dup_name.stef.snap | 2 +- ...ler__error@resolve_gens_mismatch.stef.snap | 2 +- ...ler__error@resolve_kind_mismatch.stef.snap | 2 +- .../compiler__error@resolve_root.stef.snap | 2 +- .../compiler__error@resolve_sub.stef.snap | 2 +- ...mpiler__error@resolve_sub_nested.stef.snap | 2 +- ...piler__error@resolve_sub_nested2.stef.snap | 2 +- .../compiler__error@struct_gen_dup.stef.snap | 2 +- ...ompiler__error@struct_gen_unused.stef.snap | 2 +- ...piler__error@struct_named_dup_id.stef.snap | 2 +- ...ler__error@struct_named_dup_name.stef.snap | 2 +- ...ler__error@struct_unnamed_dup_id.stef.snap | 2 +- crates/stef-parser/tests/parser.rs | 30 +++++++++---------- .../parser__error@alias_name.stef.snap | 2 +- .../parser__error@const_literal.stef.snap | 2 +- ...parser__error@const_literal_bool.stef.snap | 2 +- ...arser__error@const_literal_float.stef.snap | 2 +- .../parser__error@const_name.stef.snap | 2 +- .../parser__error@enum_name.stef.snap | 2 +- .../parser__error@field_name.stef.snap | 2 +- .../parser__error@mod_name.stef.snap | 2 +- .../parser__error@struct_name.stef.snap | 2 +- .../parser__parse@alias_basic.stef.snap | 2 +- .../parser__parse@attribute_multi.stef.snap | 2 +- .../parser__parse@attribute_single.stef.snap | 2 +- .../parser__parse@attribute_unit.stef.snap | 2 +- .../parser__parse@attributes.stef.snap | 2 +- .../parser__parse@attributes_min_ws.stef.snap | 2 +- .../parser__parse@const_basic.stef.snap | 2 +- .../parser__parse@const_string.stef.snap | 2 +- .../parser__parse@enum_basic.stef.snap | 2 +- .../parser__parse@enum_generics.stef.snap | 2 +- .../parser__parse@enum_many_ws.stef.snap | 2 +- .../parser__parse@enum_min_ws.stef.snap | 2 +- .../parser__parse@import_basic.stef.snap | 2 +- .../parser__parse@module_basic.stef.snap | 2 +- .../parser__parse@schema_basic.stef.snap | 2 +- .../parser__parse@struct_basic.stef.snap | 2 +- .../parser__parse@struct_generics.stef.snap | 2 +- .../parser__parse@struct_many_ws.stef.snap | 2 +- .../parser__parse@struct_min_ws.stef.snap | 2 +- .../parser__parse@struct_tuple.stef.snap | 2 +- .../parser__parse@types_basic.stef.snap | 2 +- .../parser__parse@types_generic.stef.snap | 2 +- .../parser__parse@types_nested.stef.snap | 2 +- .../parser__parse@types_non_zero.stef.snap | 2 +- .../parser__parse@types_ref.stef.snap | 2 +- .../parser__print@alias_basic.stef.snap | 2 +- .../parser__print@attribute_multi.stef.snap | 2 +- .../parser__print@attribute_single.stef.snap | 2 +- .../parser__print@attribute_unit.stef.snap | 2 +- .../parser__print@attributes.stef.snap | 2 +- .../parser__print@attributes_min_ws.stef.snap | 2 +- .../parser__print@const_basic.stef.snap | 2 +- .../parser__print@const_string.stef.snap | 2 +- .../parser__print@enum_basic.stef.snap | 2 +- .../parser__print@enum_generics.stef.snap | 2 +- .../parser__print@enum_many_ws.stef.snap | 2 +- .../parser__print@enum_min_ws.stef.snap | 2 +- .../parser__print@import_basic.stef.snap | 2 +- .../parser__print@module_basic.stef.snap | 2 +- .../parser__print@schema_basic.stef.snap | 2 +- .../parser__print@struct_basic.stef.snap | 2 +- .../parser__print@struct_generics.stef.snap | 2 +- .../parser__print@struct_many_ws.stef.snap | 2 +- .../parser__print@struct_min_ws.stef.snap | 2 +- .../parser__print@struct_tuple.stef.snap | 2 +- .../parser__print@types_basic.stef.snap | 2 +- .../parser__print@types_generic.stef.snap | 2 +- .../parser__print@types_nested.stef.snap | 2 +- .../parser__print@types_non_zero.stef.snap | 2 +- .../parser__print@types_ref.stef.snap | 2 +- 111 files changed, 143 insertions(+), 134 deletions(-) diff --git a/crates/stef-build/tests/compiler.rs b/crates/stef-build/tests/compiler.rs index 1266250..81b563d 100644 --- a/crates/stef-build/tests/compiler.rs +++ b/crates/stef-build/tests/compiler.rs @@ -1,6 +1,6 @@ use std::fs; -use insta::{assert_snapshot, glob}; +use insta::{assert_snapshot, glob, with_settings}; use stef_parser::Schema; #[test] @@ -11,7 +11,12 @@ fn compile_schema() { let value = stef_build::compile_schema(&value); let value = prettyplease::unparse(&syn::parse2(value.clone()).unwrap()); - assert_snapshot!("compile", format!("{value}"), input.trim()); + with_settings!({ + description => input.trim(), + omit_expression => true, + }, { + assert_snapshot!("compile", value); + }); }); } @@ -23,6 +28,11 @@ fn compile_schema_extra() { let value = stef_build::compile_schema(&value); let value = prettyplease::unparse(&syn::parse2(value.clone()).unwrap()); - assert_snapshot!("compile_extra", format!("{value}"), input.trim()); + with_settings!({ + description => input.trim(), + omit_expression => true, + }, { + assert_snapshot!("compile_extra", value); + }); }); } diff --git a/crates/stef-build/tests/snapshots/compiler__compile@alias_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@alias_basic.stef.snap index aaa498e..0e93452 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@alias_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@alias_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Sample type alias.\ntype Sample = u32;" +description: "/// Sample type alias.\ntype Sample = u32;" input_file: crates/stef-parser/tests/inputs/alias_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@attribute_multi.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@attribute_multi.stef.snap index 97ad6a9..38c8296 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@attribute_multi.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@attribute_multi.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "#[validate(min = 1, max = 100)]\nstruct Sample" +description: "#[validate(min = 1, max = 100)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_multi.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@attribute_single.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@attribute_single.stef.snap index f4051a0..c1b11d2 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@attribute_single.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@attribute_single.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "#[deprecated = \"don't use\"]\nstruct Sample" +description: "#[deprecated = \"don't use\"]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_single.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@attribute_unit.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@attribute_unit.stef.snap index 38058da..b8ea5b4 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@attribute_unit.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@attribute_unit.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "#[deprecated]\nstruct Sample" +description: "#[deprecated]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_unit.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@attributes.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@attributes.stef.snap index 9f150dc..2aa74d6 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@attributes.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@attributes.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "#[deprecated = \"don't use\", compress]\n#[validate(\n in_range(min = 100, max = 200),\n non_empty,\n)]\nstruct Sample" +description: "#[deprecated = \"don't use\", compress]\n#[validate(\n in_range(min = 100, max = 200),\n non_empty,\n)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attributes.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@attributes_min_ws.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@attributes_min_ws.stef.snap index d40aeac..caca7fd 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@attributes_min_ws.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@attributes_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "#[deprecated=\"don't use\",compress]\n#[validate(in_range(min=100,max=200),non_empty)]\nstruct Sample" +description: "#[deprecated=\"don't use\",compress]\n#[validate(in_range(min=100,max=200),non_empty)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attributes_min_ws.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@const_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@const_basic.stef.snap index cd5a6ed..1a1b83f 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@const_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@const_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "const BOOL_TRUE: bool = true;\nconst BOOL_FALSE: bool = false;\nconst INT: u32 = 100;\nconst FLOAT: f64 = 5.5;\nconst STRING: string = \"value\";\nconst BYTES: bytes = [1, 2, 3];" +description: "const BOOL_TRUE: bool = true;\nconst BOOL_FALSE: bool = false;\nconst INT: u32 = 100;\nconst FLOAT: f64 = 5.5;\nconst STRING: string = \"value\";\nconst BYTES: bytes = [1, 2, 3];" input_file: crates/stef-parser/tests/inputs/const_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@const_string.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@const_string.stef.snap index af14546..86704af 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@const_string.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@const_string.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "const SIMPLE: string = \"value\";\n\nconst NEWLINE_ESCAPE: string = \"one \\\n two \\\n three\\\n\";\n\nconst ESCAPES: string = \"escape basics \\r\\n \\t \\b \\f \\\\ \\\"\\\n hello\\\" \\n\\\n unicode \\u{2764} \\\n emoji ❤ \\\n\";\n\nconst MULTILINE: string = \"a\n b\n c\n\";" +description: "const SIMPLE: string = \"value\";\n\nconst NEWLINE_ESCAPE: string = \"one \\\n two \\\n three\\\n\";\n\nconst ESCAPES: string = \"escape basics \\r\\n \\t \\b \\f \\\\ \\\"\\\n hello\\\" \\n\\\n unicode \\u{2764} \\\n emoji ❤ \\\n\";\n\nconst MULTILINE: string = \"a\n b\n c\n\";" input_file: crates/stef-parser/tests/inputs/const_string.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@enum_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@enum_basic.stef.snap index cfc8bdc..d6d790d 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@enum_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@enum_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Sample enum.\nenum Sample {\n One @1,\n /// Second variant\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n /// Second field of third variant\n field2: bool @2,\n } @3,\n}" +description: "/// Sample enum.\nenum Sample {\n One @1,\n /// Second variant\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n /// Second field of third variant\n field2: bool @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/enum_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@enum_generics.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@enum_generics.stef.snap index 7e8ff94..b73ff14 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@enum_generics.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@enum_generics.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Enum with generics.\nenum Sample {\n One @1,\n Two(A @1, B @2) @2,\n Three {\n field1: C @1,\n field2: D @2,\n } @3,\n}" +description: "/// Enum with generics.\nenum Sample {\n One @1,\n Two(A @1, B @2) @2,\n Three {\n field1: C @1,\n field2: D @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/enum_generics.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@enum_many_ws.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@enum_many_ws.stef.snap index a6ecc5f..6d915b1 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@enum_many_ws.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@enum_many_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Sample enum.\n enum Sample {\n\n One @1,\n\n Two ( u32 @1, u64 @2) @2,\n\n Three {\n\n field1: u32 @1,\n\n field2: bool @2,\n\n } @3,\n\n }" +description: "/// Sample enum.\n enum Sample {\n\n One @1,\n\n Two ( u32 @1, u64 @2) @2,\n\n Three {\n\n field1: u32 @1,\n\n field2: bool @2,\n\n } @3,\n\n }" input_file: crates/stef-parser/tests/inputs/enum_many_ws.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@enum_min_ws.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@enum_min_ws.stef.snap index f904f6d..c3e3a7b 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@enum_min_ws.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@enum_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "enum Sample{One@1,Two(u32@1,u64@2,T@3)@2,Three{field1:u32@1,field2:bool@2,field3:T@3}@3}" +description: "enum Sample{One@1,Two(u32@1,u64@2,T@3)@2,Three{field1:u32@1,field2:bool@2,field3:T@3}@3}" input_file: crates/stef-parser/tests/inputs/enum_min_ws.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@import_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@import_basic.stef.snap index bc6b26e..6c4c5bf 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@import_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@import_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "use other::schema::Sample;\nuse second::submodule;" +description: "use other::schema::Sample;\nuse second::submodule;" input_file: crates/stef-parser/tests/inputs/import_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@module_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@module_basic.stef.snap index d989fe2..954dc83 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@module_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@module_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "mod a {\n /// Inner module\n mod b {\n enum Sample {\n One @1,\n }\n }\n\n struct Sample {\n value: u32 @1,\n }\n}" +description: "mod a {\n /// Inner module\n mod b {\n enum Sample {\n One @1,\n }\n }\n\n struct Sample {\n value: u32 @1,\n }\n}" input_file: crates/stef-parser/tests/inputs/module_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@schema_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@schema_basic.stef.snap index 9c0f86c..637313c 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@schema_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@schema_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Basic struct.\nstruct SampleStruct {\n a: u32 @1,\n b: bool @2,\n}\n\n/// Sample enum.\nenum SampleEnum {\n One @1,\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n field2: bool @2,\n } @3,\n}" +description: "/// Basic struct.\nstruct SampleStruct {\n a: u32 @1,\n b: bool @2,\n}\n\n/// Sample enum.\nenum SampleEnum {\n One @1,\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n field2: bool @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/schema_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@struct_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@struct_basic.stef.snap index 6c8d745..dfcfbac 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@struct_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@struct_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Basic struct.\nstruct Sample {\n a: u32 @1,\n /// Second field\n b: bool @2,\n}" +description: "/// Basic struct.\nstruct Sample {\n a: u32 @1,\n /// Second field\n b: bool @2,\n}" input_file: crates/stef-parser/tests/inputs/struct_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@struct_generics.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@struct_generics.stef.snap index b50e06d..2a2e25e 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@struct_generics.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@struct_generics.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Generic key-value pair.\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" +description: "/// Generic key-value pair.\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" input_file: crates/stef-parser/tests/inputs/struct_generics.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@struct_many_ws.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@struct_many_ws.stef.snap index 01c05fa..5c74b76 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@struct_many_ws.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@struct_many_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Some comment\n struct Sample<\n T\n > {\n\n a: u32 @1,\n b: bool @2,\n c: T @3,\n }" +description: "/// Some comment\n struct Sample<\n T\n > {\n\n a: u32 @1,\n b: bool @2,\n c: T @3,\n }" input_file: crates/stef-parser/tests/inputs/struct_many_ws.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@struct_min_ws.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@struct_min_ws.stef.snap index aa9412e..4c02110 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@struct_min_ws.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@struct_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "struct Sample{a:u32@1,b:bool@2,c:T@3}" +description: "struct Sample{a:u32@1,b:bool@2,c:T@3}" input_file: crates/stef-parser/tests/inputs/struct_min_ws.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@struct_tuple.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@struct_tuple.stef.snap index 5a2b73c..ff8e473 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@struct_tuple.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@struct_tuple.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Basic struct.\nstruct Sample(u32 @1, bool @2)" +description: "/// Basic struct.\nstruct Sample(u32 @1, bool @2)" input_file: crates/stef-parser/tests/inputs/struct_tuple.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@types_basic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@types_basic.stef.snap index 63e8e77..55571ec 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@types_basic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@types_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "struct Sample {\n f01: bool @1,\n f02: u8 @2,\n f03: u16 @3,\n f04: u32 @4,\n f05: u64 @5,\n f06: u128 @6,\n f07: i8 @7,\n f08: i16 @8,\n f09: i32 @9,\n f10: i64 @10,\n f11: i128 @11,\n f12: f32 @12,\n f13: f64 @13,\n f14: string @14,\n f15: &string @15,\n f16: bytes @16,\n f17: &bytes @17,\n f18: box @18,\n f19: box @19,\n f20: (u32, u32, u32) @20,\n f21: [u32; 12] @21,\n}" +description: "struct Sample {\n f01: bool @1,\n f02: u8 @2,\n f03: u16 @3,\n f04: u32 @4,\n f05: u64 @5,\n f06: u128 @6,\n f07: i8 @7,\n f08: i16 @8,\n f09: i32 @9,\n f10: i64 @10,\n f11: i128 @11,\n f12: f32 @12,\n f13: f64 @13,\n f14: string @14,\n f15: &string @15,\n f16: bytes @16,\n f17: &bytes @17,\n f18: box @18,\n f19: box @19,\n f20: (u32, u32, u32) @20,\n f21: [u32; 12] @21,\n}" input_file: crates/stef-parser/tests/inputs/types_basic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@types_generic.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@types_generic.stef.snap index de09c3a..4837487 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@types_generic.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@types_generic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "struct Sample {\n f1: vec @1,\n f2: hash_map @2,\n f3: hash_set @3,\n f4: option @4,\n f5: non_zero @5,\n}" +description: "struct Sample {\n f1: vec @1,\n f2: hash_map @2,\n f3: hash_set @3,\n f4: option @4,\n f5: non_zero @5,\n}" input_file: crates/stef-parser/tests/inputs/types_generic.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@types_nested.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@types_nested.stef.snap index 1fb2161..b880705 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@types_nested.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@types_nested.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "struct Sample {\n value: vec>>>> @1,\n}" +description: "struct Sample {\n value: vec>>>> @1,\n}" input_file: crates/stef-parser/tests/inputs/types_nested.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@types_non_zero.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@types_non_zero.stef.snap index 60a6b61..40db0f8 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@types_non_zero.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@types_non_zero.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "struct Sample {\n f01: non_zero @1,\n f02: non_zero @2,\n f03: non_zero @3,\n f04: non_zero @4,\n f05: non_zero @5,\n f06: non_zero @6,\n f07: non_zero @7,\n f08: non_zero @8,\n f09: non_zero @9,\n f10: non_zero @10,\n f11: non_zero @11,\n f12: non_zero @12,\n f13: non_zero> @13,\n f14: non_zero> @14,\n f15: non_zero> @15,\n}" +description: "struct Sample {\n f01: non_zero @1,\n f02: non_zero @2,\n f03: non_zero @3,\n f04: non_zero @4,\n f05: non_zero @5,\n f06: non_zero @6,\n f07: non_zero @7,\n f08: non_zero @8,\n f09: non_zero @9,\n f10: non_zero @10,\n f11: non_zero @11,\n f12: non_zero @12,\n f13: non_zero> @13,\n f14: non_zero> @14,\n f15: non_zero> @15,\n}" input_file: crates/stef-parser/tests/inputs/types_non_zero.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile@types_ref.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile@types_ref.stef.snap index d579ada..57f8a6d 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile@types_ref.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile@types_ref.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "struct Sample {\n basic: Test123 @1,\n with_generics: KeyValue @2,\n}\n\nenum Test123 {\n Value @1,\n}\n\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" +description: "struct Sample {\n basic: Test123 @1,\n with_generics: KeyValue @2,\n}\n\nenum Test123 {\n Value @1,\n}\n\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" input_file: crates/stef-parser/tests/inputs/types_ref.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile_extra@alias.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile_extra@alias.stef.snap index 0e6acf6..1c9e3ab 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile_extra@alias.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile_extra@alias.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Hello world!\ntype Sample = String;" +description: "/// Hello world!\ntype Sample = String;" input_file: crates/stef-build/tests/inputs_extra/alias.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile_extra@const.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile_extra@const.stef.snap index 03f07bd..8c6b700 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile_extra@const.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile_extra@const.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// A bool.\nconst BOOL: bool = true;\n/// An integer.\nconst INT: u32 = 100;\n/// A float.\nconst FLOAT: f64 = 5.0;\n/// A string.\nconst STRING: string = \"hello\";\n/// Some bytes.\nconst BYTES: bytes = [1, 2, 3];" +description: "/// A bool.\nconst BOOL: bool = true;\n/// An integer.\nconst INT: u32 = 100;\n/// A float.\nconst FLOAT: f64 = 5.0;\n/// A string.\nconst STRING: string = \"hello\";\n/// Some bytes.\nconst BYTES: bytes = [1, 2, 3];" input_file: crates/stef-build/tests/inputs_extra/const.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile_extra@enum.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile_extra@enum.stef.snap index 223a1df..79ebe86 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile_extra@enum.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile_extra@enum.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Hello world!\nenum Sample {\n Variant1 @1,\n Variant2(u32 @1, u8 @2) @2,\n Variant3 {\n field1: string @1,\n field2: vec @2,\n } @3,\n}" +description: "/// Hello world!\nenum Sample {\n Variant1 @1,\n Variant2(u32 @1, u8 @2) @2,\n Variant3 {\n field1: string @1,\n field2: vec @2,\n } @3,\n}" input_file: crates/stef-build/tests/inputs_extra/enum.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile_extra@import.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile_extra@import.stef.snap index 01ec4b0..1c31158 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile_extra@import.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile_extra@import.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "use other::module;\nuse other::module::Type;" +description: "use other::module;\nuse other::module::Type;" input_file: crates/stef-build/tests/inputs_extra/import.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile_extra@module.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile_extra@module.stef.snap index 8ff1e75..487da13 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile_extra@module.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile_extra@module.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Hello world!\nmod sample {}" +description: "/// Hello world!\nmod sample {}" input_file: crates/stef-build/tests/inputs_extra/module.stef --- #[allow(unused_imports)] diff --git a/crates/stef-build/tests/snapshots/compiler__compile_extra@struct.stef.snap b/crates/stef-build/tests/snapshots/compiler__compile_extra@struct.stef.snap index ed3dccf..976b632 100644 --- a/crates/stef-build/tests/snapshots/compiler__compile_extra@struct.stef.snap +++ b/crates/stef-build/tests/snapshots/compiler__compile_extra@struct.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-build/tests/compiler.rs -expression: "/// Hello world!\nstruct Sample {\n field1: u32 @1,\n field2: bytes @2,\n field3: (bool, [i16; 4]) @3,\n}" +description: "/// Hello world!\nstruct Sample {\n field1: u32 @1,\n field2: bytes @2,\n field3: (bool, [i16; 4]) @3,\n}" input_file: crates/stef-build/tests/inputs_extra/struct.stef --- #[allow(unused_imports)] diff --git a/crates/stef-compiler/tests/compiler.rs b/crates/stef-compiler/tests/compiler.rs index 43f8988..b18a162 100644 --- a/crates/stef-compiler/tests/compiler.rs +++ b/crates/stef-compiler/tests/compiler.rs @@ -3,7 +3,7 @@ use std::{ fs, }; -use insta::{assert_snapshot, glob}; +use insta::{assert_snapshot,with_settings, glob}; use miette::{Diagnostic, MietteHandler, MietteHandlerOpts, NamedSource, Report, ReportHandler}; use stef_parser::Schema; @@ -32,13 +32,14 @@ fn compile_invalid_schema() { let result = stef_compiler::validate_schema(name, &schema).unwrap_err(); let report = Report::new(result).with_source_code(NamedSource::new( path.file_name().unwrap().to_string_lossy(), - input, + input.clone(), )); - assert_snapshot!( - "error", - Wrapper(&handler, &*report).to_string(), - stringify!(stef_compiler::validate_schema(&schema).unwrap_err()) - ); + with_settings!({ + description => input.trim(), + omit_expression => true, + }, { + assert_snapshot!("error", Wrapper(&handler, &*report).to_string()); + }); }); } diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_dup.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_dup.stef.snap index f85ed16..aed1a59 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_dup.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_dup.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "enum Sample {\n One @1,\n Two { value: T @1 } @2,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/enum_gen_dup.stef --- × invalid generic type found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_unused.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_unused.stef.snap index 2a54cce..fdb9f2d 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_unused.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@enum_gen_unused.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "enum Sample {\n One @1,\n Two { value: string @1 } @2,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/enum_gen_unused.stef --- × invalid generic type found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_id.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_id.stef.snap index a9f40e8..7e32539 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_id.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_id.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "enum Sample {\n One @1,\n Two {\n field1: string @1,\n field2: string @1,\n } @2,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/enum_named_dup_id.stef --- × duplicate ID found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_name.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_name.stef.snap index e63e045..7e07aa7 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_name.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@enum_named_dup_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "enum Sample {\n One @1,\n Two {\n field: string @1,\n field: string @2,\n } @2,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/enum_named_dup_name.stef --- × duplicate name found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@enum_unnamed_dup_id.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@enum_unnamed_dup_id.stef.snap index ecd654e..ddab049 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@enum_unnamed_dup_id.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@enum_unnamed_dup_id.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "enum Sample {\n One @1,\n Two(string @1, string @1) @2,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/enum_unnamed_dup_id.stef --- × duplicate ID found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_id.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_id.stef.snap index 1b19dc1..71a58ae 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_id.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_id.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "enum Sample {\n One @1,\n Two @1,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/enum_variant_dup_id.stef --- × duplicate ID found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_name.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_name.stef.snap index 57f2a3b..85e02fc 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_name.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@enum_variant_dup_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "enum Sample {\n One @1,\n One @2,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/enum_variant_dup_name.stef --- × duplicate name found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_gens_mismatch.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_gens_mismatch.stef.snap index 0fd246d..85caf5c 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_gens_mismatch.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_gens_mismatch.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: Other @1,\n}\n\nstruct Other(T @1)" input_file: crates/stef-compiler/tests/inputs/invalid/resolve_gens_mismatch.stef --- × type resolution failed diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_kind_mismatch.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_kind_mismatch.stef.snap index db2bf46..5b3e821 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_kind_mismatch.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_kind_mismatch.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: OTHER @1,\n}\n\nconst OTHER: u32 = 1;" input_file: crates/stef-compiler/tests/inputs/invalid/resolve_kind_mismatch.stef --- × type resolution failed diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_root.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_root.stef.snap index cb970f4..d60c0cc 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_root.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_root.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: Other @1,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/resolve_root.stef --- × type resolution failed diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub.stef.snap index 6a7566d..9174856 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: inner::Other @1,\n}\n\nmod inner {}" input_file: crates/stef-compiler/tests/inputs/invalid/resolve_sub.stef --- × type resolution failed diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested.stef.snap index c501a6d..2386e2b 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: inner::a::b::c::Other @1,\n}\n\nmod inner {\n mod a {\n mod b {\n mod c {}\n }\n }\n}" input_file: crates/stef-compiler/tests/inputs/invalid/resolve_sub_nested.stef --- × type resolution failed diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested2.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested2.stef.snap index b2227fa..d8b3b1f 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested2.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@resolve_sub_nested2.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: inner::a::b::c::Other @1,\n}\n\nmod inner {\n mod a {\n mod d {\n mod c {}\n }\n }\n}" input_file: crates/stef-compiler/tests/inputs/invalid/resolve_sub_nested2.stef --- × type resolution failed diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_dup.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_dup.stef.snap index c834edc..9b1ed47 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_dup.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_dup.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: T @1,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/struct_gen_dup.stef --- × invalid generic type found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_unused.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_unused.stef.snap index 1d5a4b2..70a051e 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_unused.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@struct_gen_unused.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n value: string @1,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/struct_gen_unused.stef --- × invalid generic type found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_id.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_id.stef.snap index f232350..20d4de4 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_id.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_id.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n field1: string @1,\n field2: string @1,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/struct_named_dup_id.stef --- × duplicate ID found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_name.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_name.stef.snap index cfd9cb1..c459e52 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_name.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@struct_named_dup_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample {\n field: string @1,\n field: string @2,\n}" input_file: crates/stef-compiler/tests/inputs/invalid/struct_named_dup_name.stef --- × duplicate name found diff --git a/crates/stef-compiler/tests/snapshots/compiler__error@struct_unnamed_dup_id.stef.snap b/crates/stef-compiler/tests/snapshots/compiler__error@struct_unnamed_dup_id.stef.snap index 75643d4..7a40ce3 100644 --- a/crates/stef-compiler/tests/snapshots/compiler__error@struct_unnamed_dup_id.stef.snap +++ b/crates/stef-compiler/tests/snapshots/compiler__error@struct_unnamed_dup_id.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-compiler/tests/compiler.rs -expression: "stef_compiler :: validate_schema(& schema).unwrap_err()" +description: "struct Sample(string @1, string @1)" input_file: crates/stef-compiler/tests/inputs/invalid/struct_unnamed_dup_id.stef --- × duplicate ID found diff --git a/crates/stef-parser/tests/parser.rs b/crates/stef-parser/tests/parser.rs index 8038a02..2645b63 100644 --- a/crates/stef-parser/tests/parser.rs +++ b/crates/stef-parser/tests/parser.rs @@ -3,7 +3,7 @@ use std::{ fs, }; -use insta::{assert_snapshot, glob}; +use insta::{assert_snapshot, glob, with_settings}; use miette::{Diagnostic, MietteHandler, MietteHandlerOpts, ReportHandler}; use stef_parser::Schema; @@ -13,16 +13,13 @@ fn parse_schema() { let input = fs::read_to_string(path).unwrap(); let value = Schema::parse(input.as_str()).unwrap(); - assert_snapshot!( - "parse", - format!("{value:#?}"), - stringify!(Schema::parse(input.as_str()).unwrap()) - ); - assert_snapshot!( - "print", - value.to_string(), - stringify!(Schema::parse(input.as_str()).unwrap()) - ); + with_settings!({ + description => input.trim(), + omit_expression => true, + }, { + assert_snapshot!("parse", format!("{value:#?}")); + assert_snapshot!("print", value.to_string()); + }); }); } @@ -47,10 +44,11 @@ fn parse_invalid_schema() { let input = fs::read_to_string(path).unwrap(); let value = Schema::parse(input.as_str()).unwrap_err(); - insta::assert_snapshot!( - "error", - Wrapper(&handler, &*value).to_string(), - stringify!(Schema::parse(input.as_str()).unwrap_err()) - ); + with_settings!({ + description => input.trim(), + omit_expression => true, + }, { + assert_snapshot!("error", Wrapper(&handler, &*value).to_string()); + }); }); } diff --git a/crates/stef-parser/tests/snapshots/parser__error@alias_name.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@alias_name.stef.snap index 7552375..eed27b0 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@alias_name.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@alias_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: type sImple = Simple; input_file: crates/stef-parser/tests/inputs/invalid/alias_name.stef --- stef::parse::alias_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseAliasError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@const_literal.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@const_literal.stef.snap index 2cd1ecd..a34e249 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@const_literal.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@const_literal.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "const VALUE: u32 = 1z;" input_file: crates/stef-parser/tests/inputs/invalid/const_literal.stef --- stef::parse::const_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseConstError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@const_literal_bool.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@const_literal_bool.stef.snap index 659a2f9..15e60e5 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@const_literal_bool.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@const_literal_bool.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "const VALUE: bool = truze;" input_file: crates/stef-parser/tests/inputs/invalid/const_literal_bool.stef --- stef::parse::const_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseConstError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@const_literal_float.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@const_literal_float.stef.snap index 806d505..31fa16d 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@const_literal_float.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@const_literal_float.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "const VALUE: f64 = 1.0z;" input_file: crates/stef-parser/tests/inputs/invalid/const_literal_float.stef --- stef::parse::const_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseConstError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@const_name.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@const_name.stef.snap index 3487930..5fa2636 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@const_name.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@const_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "const vALUE: u32 = 1;" input_file: crates/stef-parser/tests/inputs/invalid/const_name.stef --- stef::parse::const_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseConstError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@enum_name.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@enum_name.stef.snap index c59ffde..0d4ae4c 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@enum_name.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@enum_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "enum sample {\n One @1,\n}" input_file: crates/stef-parser/tests/inputs/invalid/enum_name.stef --- stef::parse::enum_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseEnumError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@field_name.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@field_name.stef.snap index f669bde..5030302 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@field_name.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@field_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "struct Sample {\n 1value: u32 @1,\n}" input_file: crates/stef-parser/tests/inputs/invalid/field_name.stef --- stef::parse::struct_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseStructError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@mod_name.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@mod_name.stef.snap index bbc5743..e943907 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@mod_name.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@mod_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "mod Sample {}" input_file: crates/stef-parser/tests/inputs/invalid/mod_name.stef --- stef::parse::mod_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseModuleError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__error@struct_name.stef.snap b/crates/stef-parser/tests/snapshots/parser__error@struct_name.stef.snap index 27872b1..2a3c20a 100644 --- a/crates/stef-parser/tests/snapshots/parser__error@struct_name.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__error@struct_name.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap_err()" +description: "struct sample {\n value: u32 @1,\n}" input_file: crates/stef-parser/tests/inputs/invalid/struct_name.stef --- stef::parse::struct_def (https://docs.rs/stef-parser/0.1.0/stef_parser/error/struct.ParseStructError.html) diff --git a/crates/stef-parser/tests/snapshots/parser__parse@alias_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@alias_basic.stef.snap index 4f9ae95..d3d07ce 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@alias_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@alias_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Sample type alias.\ntype Sample = u32;" input_file: crates/stef-parser/tests/inputs/alias_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@attribute_multi.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@attribute_multi.stef.snap index b9e96d8..041e170 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@attribute_multi.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@attribute_multi.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[validate(min = 1, max = 100)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_multi.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@attribute_single.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@attribute_single.stef.snap index 163068d..538bba3 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@attribute_single.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@attribute_single.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated = \"don't use\"]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_single.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@attribute_unit.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@attribute_unit.stef.snap index 06a01a2..34bf153 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@attribute_unit.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@attribute_unit.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_unit.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@attributes.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@attributes.stef.snap index 79edbed..4e0eded 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@attributes.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@attributes.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated = \"don't use\", compress]\n#[validate(\n in_range(min = 100, max = 200),\n non_empty,\n)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attributes.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@attributes_min_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@attributes_min_ws.stef.snap index aea5aa6..d50fab3 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@attributes_min_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@attributes_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated=\"don't use\",compress]\n#[validate(in_range(min=100,max=200),non_empty)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attributes_min_ws.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@const_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@const_basic.stef.snap index 83e9f6b..6b4fc60 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@const_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@const_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "const BOOL_TRUE: bool = true;\nconst BOOL_FALSE: bool = false;\nconst INT: u32 = 100;\nconst FLOAT: f64 = 5.5;\nconst STRING: string = \"value\";\nconst BYTES: bytes = [1, 2, 3];" input_file: crates/stef-parser/tests/inputs/const_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@const_string.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@const_string.stef.snap index ffe8fd5..9c9172a 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@const_string.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@const_string.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "const SIMPLE: string = \"value\";\n\nconst NEWLINE_ESCAPE: string = \"one \\\n two \\\n three\\\n\";\n\nconst ESCAPES: string = \"escape basics \\r\\n \\t \\b \\f \\\\ \\\"\\\n hello\\\" \\n\\\n unicode \\u{2764} \\\n emoji ❤ \\\n\";\n\nconst MULTILINE: string = \"a\n b\n c\n\";" input_file: crates/stef-parser/tests/inputs/const_string.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@enum_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@enum_basic.stef.snap index 7ced041..9cdb82f 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@enum_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@enum_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Sample enum.\nenum Sample {\n One @1,\n /// Second variant\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n /// Second field of third variant\n field2: bool @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/enum_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@enum_generics.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@enum_generics.stef.snap index 8f963f4..181de33 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@enum_generics.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@enum_generics.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Enum with generics.\nenum Sample {\n One @1,\n Two(A @1, B @2) @2,\n Three {\n field1: C @1,\n field2: D @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/enum_generics.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@enum_many_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@enum_many_ws.stef.snap index e8de916..d8664f2 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@enum_many_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@enum_many_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Sample enum.\n enum Sample {\n\n One @1,\n\n Two ( u32 @1, u64 @2) @2,\n\n Three {\n\n field1: u32 @1,\n\n field2: bool @2,\n\n } @3,\n\n }" input_file: crates/stef-parser/tests/inputs/enum_many_ws.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@enum_min_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@enum_min_ws.stef.snap index cf79c57..5fb90e2 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@enum_min_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@enum_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "enum Sample{One@1,Two(u32@1,u64@2,T@3)@2,Three{field1:u32@1,field2:bool@2,field3:T@3}@3}" input_file: crates/stef-parser/tests/inputs/enum_min_ws.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@import_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@import_basic.stef.snap index 8930035..3f7722d 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@import_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@import_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "use other::schema::Sample;\nuse second::submodule;" input_file: crates/stef-parser/tests/inputs/import_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@module_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@module_basic.stef.snap index 3039c5c..5d61a65 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@module_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@module_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "mod a {\n /// Inner module\n mod b {\n enum Sample {\n One @1,\n }\n }\n\n struct Sample {\n value: u32 @1,\n }\n}" input_file: crates/stef-parser/tests/inputs/module_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@schema_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@schema_basic.stef.snap index 09bd773..cb355b8 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@schema_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@schema_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Basic struct.\nstruct SampleStruct {\n a: u32 @1,\n b: bool @2,\n}\n\n/// Sample enum.\nenum SampleEnum {\n One @1,\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n field2: bool @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/schema_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@struct_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@struct_basic.stef.snap index dc0a1c2..e277ac6 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@struct_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@struct_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Basic struct.\nstruct Sample {\n a: u32 @1,\n /// Second field\n b: bool @2,\n}" input_file: crates/stef-parser/tests/inputs/struct_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@struct_generics.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@struct_generics.stef.snap index 5624876..846c0bd 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@struct_generics.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@struct_generics.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Generic key-value pair.\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" input_file: crates/stef-parser/tests/inputs/struct_generics.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@struct_many_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@struct_many_ws.stef.snap index 7bddd99..139f2ba 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@struct_many_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@struct_many_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Some comment\n struct Sample<\n T\n > {\n\n a: u32 @1,\n b: bool @2,\n c: T @3,\n }" input_file: crates/stef-parser/tests/inputs/struct_many_ws.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@struct_min_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@struct_min_ws.stef.snap index 7410f3a..59c078e 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@struct_min_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@struct_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample{a:u32@1,b:bool@2,c:T@3}" input_file: crates/stef-parser/tests/inputs/struct_min_ws.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@struct_tuple.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@struct_tuple.stef.snap index 77c1aac..1cff906 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@struct_tuple.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@struct_tuple.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Basic struct.\nstruct Sample(u32 @1, bool @2)" input_file: crates/stef-parser/tests/inputs/struct_tuple.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@types_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@types_basic.stef.snap index 1686dde..f7c14dc 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@types_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@types_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n f01: bool @1,\n f02: u8 @2,\n f03: u16 @3,\n f04: u32 @4,\n f05: u64 @5,\n f06: u128 @6,\n f07: i8 @7,\n f08: i16 @8,\n f09: i32 @9,\n f10: i64 @10,\n f11: i128 @11,\n f12: f32 @12,\n f13: f64 @13,\n f14: string @14,\n f15: &string @15,\n f16: bytes @16,\n f17: &bytes @17,\n f18: box @18,\n f19: box @19,\n f20: (u32, u32, u32) @20,\n f21: [u32; 12] @21,\n}" input_file: crates/stef-parser/tests/inputs/types_basic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@types_generic.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@types_generic.stef.snap index 8dfe208..35aa2ee 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@types_generic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@types_generic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n f1: vec @1,\n f2: hash_map @2,\n f3: hash_set @3,\n f4: option @4,\n f5: non_zero @5,\n}" input_file: crates/stef-parser/tests/inputs/types_generic.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@types_nested.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@types_nested.stef.snap index e440292..b281049 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@types_nested.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@types_nested.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n value: vec>>>> @1,\n}" input_file: crates/stef-parser/tests/inputs/types_nested.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@types_non_zero.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@types_non_zero.stef.snap index 92b1772..3d44cc9 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@types_non_zero.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@types_non_zero.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n f01: non_zero @1,\n f02: non_zero @2,\n f03: non_zero @3,\n f04: non_zero @4,\n f05: non_zero @5,\n f06: non_zero @6,\n f07: non_zero @7,\n f08: non_zero @8,\n f09: non_zero @9,\n f10: non_zero @10,\n f11: non_zero @11,\n f12: non_zero @12,\n f13: non_zero> @13,\n f14: non_zero> @14,\n f15: non_zero> @15,\n}" input_file: crates/stef-parser/tests/inputs/types_non_zero.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__parse@types_ref.stef.snap b/crates/stef-parser/tests/snapshots/parser__parse@types_ref.stef.snap index 034bd99..32ae7d2 100644 --- a/crates/stef-parser/tests/snapshots/parser__parse@types_ref.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__parse@types_ref.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n basic: Test123 @1,\n with_generics: KeyValue @2,\n}\n\nenum Test123 {\n Value @1,\n}\n\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" input_file: crates/stef-parser/tests/inputs/types_ref.stef --- Schema { diff --git a/crates/stef-parser/tests/snapshots/parser__print@alias_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@alias_basic.stef.snap index 12ec96b..d6e30e2 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@alias_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@alias_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Sample type alias.\ntype Sample = u32;" input_file: crates/stef-parser/tests/inputs/alias_basic.stef --- /// Sample type alias. diff --git a/crates/stef-parser/tests/snapshots/parser__print@attribute_multi.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@attribute_multi.stef.snap index 6bbf6bd..a59a4cf 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@attribute_multi.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@attribute_multi.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[validate(min = 1, max = 100)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_multi.stef --- #[validate(min = 1, max = 100)] diff --git a/crates/stef-parser/tests/snapshots/parser__print@attribute_single.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@attribute_single.stef.snap index a9f2da8..89ffe8e 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@attribute_single.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@attribute_single.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated = \"don't use\"]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_single.stef --- #[deprecated = "don't use"] diff --git a/crates/stef-parser/tests/snapshots/parser__print@attribute_unit.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@attribute_unit.stef.snap index 5e738bf..e5afbc0 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@attribute_unit.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@attribute_unit.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attribute_unit.stef --- #[deprecated] diff --git a/crates/stef-parser/tests/snapshots/parser__print@attributes.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@attributes.stef.snap index f066a05..770958d 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@attributes.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@attributes.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated = \"don't use\", compress]\n#[validate(\n in_range(min = 100, max = 200),\n non_empty,\n)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attributes.stef --- #[deprecated = "don't use", compress, validate(in_range(min = 100, max = 200), non_empty)] diff --git a/crates/stef-parser/tests/snapshots/parser__print@attributes_min_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@attributes_min_ws.stef.snap index 2dcc3bc..3f42674 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@attributes_min_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@attributes_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "#[deprecated=\"don't use\",compress]\n#[validate(in_range(min=100,max=200),non_empty)]\nstruct Sample" input_file: crates/stef-parser/tests/inputs/attributes_min_ws.stef --- #[deprecated = "don't use", compress, validate(in_range(min = 100, max = 200), non_empty)] diff --git a/crates/stef-parser/tests/snapshots/parser__print@const_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@const_basic.stef.snap index 7dc6cb1..2e1d029 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@const_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@const_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "const BOOL_TRUE: bool = true;\nconst BOOL_FALSE: bool = false;\nconst INT: u32 = 100;\nconst FLOAT: f64 = 5.5;\nconst STRING: string = \"value\";\nconst BYTES: bytes = [1, 2, 3];" input_file: crates/stef-parser/tests/inputs/const_basic.stef --- const BOOL_TRUE: bool = true; diff --git a/crates/stef-parser/tests/snapshots/parser__print@const_string.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@const_string.stef.snap index cdd4a29..67cf379 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@const_string.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@const_string.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "const SIMPLE: string = \"value\";\n\nconst NEWLINE_ESCAPE: string = \"one \\\n two \\\n three\\\n\";\n\nconst ESCAPES: string = \"escape basics \\r\\n \\t \\b \\f \\\\ \\\"\\\n hello\\\" \\n\\\n unicode \\u{2764} \\\n emoji ❤ \\\n\";\n\nconst MULTILINE: string = \"a\n b\n c\n\";" input_file: crates/stef-parser/tests/inputs/const_string.stef --- const SIMPLE: string = "value"; diff --git a/crates/stef-parser/tests/snapshots/parser__print@enum_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@enum_basic.stef.snap index c9b656d..2b12159 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@enum_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@enum_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Sample enum.\nenum Sample {\n One @1,\n /// Second variant\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n /// Second field of third variant\n field2: bool @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/enum_basic.stef --- /// Sample enum. diff --git a/crates/stef-parser/tests/snapshots/parser__print@enum_generics.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@enum_generics.stef.snap index 5f07ae7..0e3346b 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@enum_generics.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@enum_generics.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Enum with generics.\nenum Sample {\n One @1,\n Two(A @1, B @2) @2,\n Three {\n field1: C @1,\n field2: D @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/enum_generics.stef --- /// Enum with generics. diff --git a/crates/stef-parser/tests/snapshots/parser__print@enum_many_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@enum_many_ws.stef.snap index 0ba9444..0226ebe 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@enum_many_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@enum_many_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Sample enum.\n enum Sample {\n\n One @1,\n\n Two ( u32 @1, u64 @2) @2,\n\n Three {\n\n field1: u32 @1,\n\n field2: bool @2,\n\n } @3,\n\n }" input_file: crates/stef-parser/tests/inputs/enum_many_ws.stef --- /// Sample enum. diff --git a/crates/stef-parser/tests/snapshots/parser__print@enum_min_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@enum_min_ws.stef.snap index 6b9e611..29dc346 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@enum_min_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@enum_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "enum Sample{One@1,Two(u32@1,u64@2,T@3)@2,Three{field1:u32@1,field2:bool@2,field3:T@3}@3}" input_file: crates/stef-parser/tests/inputs/enum_min_ws.stef --- enum Sample { diff --git a/crates/stef-parser/tests/snapshots/parser__print@import_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@import_basic.stef.snap index 2295634..b2641f7 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@import_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@import_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "use other::schema::Sample;\nuse second::submodule;" input_file: crates/stef-parser/tests/inputs/import_basic.stef --- use other::schema::Sample; diff --git a/crates/stef-parser/tests/snapshots/parser__print@module_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@module_basic.stef.snap index 4d4da9a..02af4d4 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@module_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@module_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "mod a {\n /// Inner module\n mod b {\n enum Sample {\n One @1,\n }\n }\n\n struct Sample {\n value: u32 @1,\n }\n}" input_file: crates/stef-parser/tests/inputs/module_basic.stef --- mod a { diff --git a/crates/stef-parser/tests/snapshots/parser__print@schema_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@schema_basic.stef.snap index 4037e6c..85940fa 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@schema_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@schema_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Basic struct.\nstruct SampleStruct {\n a: u32 @1,\n b: bool @2,\n}\n\n/// Sample enum.\nenum SampleEnum {\n One @1,\n Two(u32 @1, u64 @2) @2,\n Three {\n field1: u32 @1,\n field2: bool @2,\n } @3,\n}" input_file: crates/stef-parser/tests/inputs/schema_basic.stef --- /// Basic struct. diff --git a/crates/stef-parser/tests/snapshots/parser__print@struct_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@struct_basic.stef.snap index ae5a760..36eb65c 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@struct_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@struct_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Basic struct.\nstruct Sample {\n a: u32 @1,\n /// Second field\n b: bool @2,\n}" input_file: crates/stef-parser/tests/inputs/struct_basic.stef --- /// Basic struct. diff --git a/crates/stef-parser/tests/snapshots/parser__print@struct_generics.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@struct_generics.stef.snap index 1550600..61ecefd 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@struct_generics.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@struct_generics.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Generic key-value pair.\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" input_file: crates/stef-parser/tests/inputs/struct_generics.stef --- /// Generic key-value pair. diff --git a/crates/stef-parser/tests/snapshots/parser__print@struct_many_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@struct_many_ws.stef.snap index 9d26cde..a694ea3 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@struct_many_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@struct_many_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Some comment\n struct Sample<\n T\n > {\n\n a: u32 @1,\n b: bool @2,\n c: T @3,\n }" input_file: crates/stef-parser/tests/inputs/struct_many_ws.stef --- /// Some comment diff --git a/crates/stef-parser/tests/snapshots/parser__print@struct_min_ws.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@struct_min_ws.stef.snap index c9f086d..23504c4 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@struct_min_ws.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@struct_min_ws.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample{a:u32@1,b:bool@2,c:T@3}" input_file: crates/stef-parser/tests/inputs/struct_min_ws.stef --- struct Sample { diff --git a/crates/stef-parser/tests/snapshots/parser__print@struct_tuple.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@struct_tuple.stef.snap index b44b6ad..2757b31 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@struct_tuple.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@struct_tuple.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "/// Basic struct.\nstruct Sample(u32 @1, bool @2)" input_file: crates/stef-parser/tests/inputs/struct_tuple.stef --- /// Basic struct. diff --git a/crates/stef-parser/tests/snapshots/parser__print@types_basic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@types_basic.stef.snap index 555c98c..ff4c293 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@types_basic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@types_basic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n f01: bool @1,\n f02: u8 @2,\n f03: u16 @3,\n f04: u32 @4,\n f05: u64 @5,\n f06: u128 @6,\n f07: i8 @7,\n f08: i16 @8,\n f09: i32 @9,\n f10: i64 @10,\n f11: i128 @11,\n f12: f32 @12,\n f13: f64 @13,\n f14: string @14,\n f15: &string @15,\n f16: bytes @16,\n f17: &bytes @17,\n f18: box @18,\n f19: box @19,\n f20: (u32, u32, u32) @20,\n f21: [u32; 12] @21,\n}" input_file: crates/stef-parser/tests/inputs/types_basic.stef --- struct Sample { diff --git a/crates/stef-parser/tests/snapshots/parser__print@types_generic.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@types_generic.stef.snap index d1a6960..f9a15d9 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@types_generic.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@types_generic.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n f1: vec @1,\n f2: hash_map @2,\n f3: hash_set @3,\n f4: option @4,\n f5: non_zero @5,\n}" input_file: crates/stef-parser/tests/inputs/types_generic.stef --- struct Sample { diff --git a/crates/stef-parser/tests/snapshots/parser__print@types_nested.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@types_nested.stef.snap index a660646..4cb3f88 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@types_nested.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@types_nested.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n value: vec>>>> @1,\n}" input_file: crates/stef-parser/tests/inputs/types_nested.stef --- struct Sample { diff --git a/crates/stef-parser/tests/snapshots/parser__print@types_non_zero.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@types_non_zero.stef.snap index 151baea..e79fbe3 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@types_non_zero.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@types_non_zero.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n f01: non_zero @1,\n f02: non_zero @2,\n f03: non_zero @3,\n f04: non_zero @4,\n f05: non_zero @5,\n f06: non_zero @6,\n f07: non_zero @7,\n f08: non_zero @8,\n f09: non_zero @9,\n f10: non_zero @10,\n f11: non_zero @11,\n f12: non_zero @12,\n f13: non_zero> @13,\n f14: non_zero> @14,\n f15: non_zero> @15,\n}" input_file: crates/stef-parser/tests/inputs/types_non_zero.stef --- struct Sample { diff --git a/crates/stef-parser/tests/snapshots/parser__print@types_ref.stef.snap b/crates/stef-parser/tests/snapshots/parser__print@types_ref.stef.snap index 246f7fc..b1327f3 100644 --- a/crates/stef-parser/tests/snapshots/parser__print@types_ref.stef.snap +++ b/crates/stef-parser/tests/snapshots/parser__print@types_ref.stef.snap @@ -1,6 +1,6 @@ --- source: crates/stef-parser/tests/parser.rs -expression: "Schema :: parse(input.as_str()).unwrap()" +description: "struct Sample {\n basic: Test123 @1,\n with_generics: KeyValue @2,\n}\n\nenum Test123 {\n Value @1,\n}\n\nstruct KeyValue {\n key: K @1,\n value: V @2,\n}" input_file: crates/stef-parser/tests/inputs/types_ref.stef --- struct Sample {