-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: enable more snapshot tests and fix errors
- Loading branch information
Showing
24 changed files
with
1,075 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
crates/stef-build/tests/snapshots/parser__compile@alias-basic.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.rs | ||
expression: "/// Sample type alias.\ntype Sample = u32;" | ||
input_file: crates/stef-parser/tests/inputs/alias-basic.stef | ||
--- | ||
/// Sample type alias. | ||
pub type Sample = u32; | ||
|
21 changes: 21 additions & 0 deletions
21
crates/stef-build/tests/snapshots/parser__compile@attribute-multi.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.rs | ||
expression: "#[validate(min = 1, max = 100)]\nstruct Sample" | ||
input_file: crates/stef-parser/tests/inputs/attribute-multi.stef | ||
--- | ||
pub struct Sample; | ||
impl ::stef::Encode for Sample { | ||
fn encode(&self, w: &mut impl ::stef::BufMut) {} | ||
} | ||
impl ::stef::Decode for Sample { | ||
fn decode(r: &mut impl ::stef::Buf) -> ::stef::buf::Result<Self> { | ||
loop { | ||
match ::stef::buf::decode_id(r)? { | ||
::stef::buf::END_MARKER => break, | ||
_ => continue, | ||
} | ||
} | ||
Ok(Self) | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
crates/stef-build/tests/snapshots/parser__compile@attribute-single.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.rs | ||
expression: "#[deprecated = \"don't use\"]\nstruct Sample" | ||
input_file: crates/stef-parser/tests/inputs/attribute-single.stef | ||
--- | ||
pub struct Sample; | ||
impl ::stef::Encode for Sample { | ||
fn encode(&self, w: &mut impl ::stef::BufMut) {} | ||
} | ||
impl ::stef::Decode for Sample { | ||
fn decode(r: &mut impl ::stef::Buf) -> ::stef::buf::Result<Self> { | ||
loop { | ||
match ::stef::buf::decode_id(r)? { | ||
::stef::buf::END_MARKER => break, | ||
_ => continue, | ||
} | ||
} | ||
Ok(Self) | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
crates/stef-build/tests/snapshots/parser__compile@attribute-unit.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.rs | ||
expression: "#[deprecated]\nstruct Sample" | ||
input_file: crates/stef-parser/tests/inputs/attribute-unit.stef | ||
--- | ||
pub struct Sample; | ||
impl ::stef::Encode for Sample { | ||
fn encode(&self, w: &mut impl ::stef::BufMut) {} | ||
} | ||
impl ::stef::Decode for Sample { | ||
fn decode(r: &mut impl ::stef::Buf) -> ::stef::buf::Result<Self> { | ||
loop { | ||
match ::stef::buf::decode_id(r)? { | ||
::stef::buf::END_MARKER => break, | ||
_ => continue, | ||
} | ||
} | ||
Ok(Self) | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
crates/stef-build/tests/snapshots/parser__compile@attributes-min-ws.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.rs | ||
expression: "#[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 | ||
--- | ||
pub struct Sample; | ||
impl ::stef::Encode for Sample { | ||
fn encode(&self, w: &mut impl ::stef::BufMut) {} | ||
} | ||
impl ::stef::Decode for Sample { | ||
fn decode(r: &mut impl ::stef::Buf) -> ::stef::buf::Result<Self> { | ||
loop { | ||
match ::stef::buf::decode_id(r)? { | ||
::stef::buf::END_MARKER => break, | ||
_ => continue, | ||
} | ||
} | ||
Ok(Self) | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
crates/stef-build/tests/snapshots/parser__compile@attributes.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.rs | ||
expression: "#[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 | ||
--- | ||
pub struct Sample; | ||
impl ::stef::Encode for Sample { | ||
fn encode(&self, w: &mut impl ::stef::BufMut) {} | ||
} | ||
impl ::stef::Decode for Sample { | ||
fn decode(r: &mut impl ::stef::Buf) -> ::stef::buf::Result<Self> { | ||
loop { | ||
match ::stef::buf::decode_id(r)? { | ||
::stef::buf::END_MARKER => break, | ||
_ => continue, | ||
} | ||
} | ||
Ok(Self) | ||
} | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
crates/stef-build/tests/snapshots/parser__compile@const-basic.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.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];" | ||
input_file: crates/stef-parser/tests/inputs/const-basic.stef | ||
--- | ||
const BOOL_TRUE: bool = true; | ||
const BOOL_FALSE: bool = false; | ||
const INT: u32 = 100; | ||
const FLOAT: f64 = 5.5; | ||
const STRING: &str = "value"; | ||
const BYTES: &[u8] = b"\x01\x02\x03"; | ||
|
10 changes: 10 additions & 0 deletions
10
crates/stef-build/tests/snapshots/parser__compile@const-string.stef.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: crates/stef-build/tests/parser.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\";" | ||
input_file: crates/stef-parser/tests/inputs/const-string.stef | ||
--- | ||
const SIMPLE: &str = "value"; | ||
const NEWLINE_ESCAPE: &str = "one two three"; | ||
const ESCAPES: &str = "escape basics \r\n \t \u{8} \u{c} \\ \"hello\" \nunicode ❤ emoji ❤ "; | ||
const MULTILINE: &str = "a\n b\n c\n"; | ||
|
Oops, something went wrong.