diff --git a/Cargo.lock b/Cargo.lock index 1dd56f9..6339acc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,19 +20,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "console" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" -dependencies = [ - "encode_unicode", - "libc", - "once_cell", - "terminal_size", - "winapi", -] - [[package]] name = "darling" version = "0.14.1" @@ -69,10 +56,20 @@ dependencies = [ ] [[package]] -name = "encode_unicode" -version = "0.3.6" +name = "dissimilar" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "8c97b9233581d84b8e1e689cdd3a47b6f69770084fc246e86a7f78b0d9c1d4a5" + +[[package]] +name = "expect-test" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d4661aca38d826eb7c72fe128e4238220616de4c0cc00db7bfc38e2e1364dd3" +dependencies = [ + "dissimilar", + "once_cell", +] [[package]] name = "fnv" @@ -80,60 +77,18 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "insta" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4126dd76ebfe2561486a1bd6738a33d2029ffb068a99ac446b7f8c77b2e58dbc" -dependencies = [ - "console", - "once_cell", - "serde", - "serde_json", - "serde_yaml", - "similar", -] - -[[package]] -name = "itoa" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" - [[package]] name = "libc" version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "nix" version = "0.25.0" @@ -181,7 +136,7 @@ version = "0.0.0" name = "oyster_parser" version = "0.0.0" dependencies = [ - "insta", + "expect-test", "thiserror", ] @@ -189,7 +144,7 @@ dependencies = [ name = "oyster_runtime" version = "0.0.0" dependencies = [ - "insta", + "expect-test", "nix", "oyster_builtin_proc", "oyster_parser", @@ -225,60 +180,11 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "ryu" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" - [[package]] name = "serde" version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_yaml" -version = "0.8.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec0091e1f5aa338283ce049bd9dfefd55e1f168ac233e85c1ffe0038fb48cbe" -dependencies = [ - "indexmap", - "ryu", - "serde", - "yaml-rust", -] - -[[package]] -name = "similar" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3" [[package]] name = "strsim" @@ -297,16 +203,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "thiserror" version = "1.0.35" @@ -341,34 +237,3 @@ name = "unicode-ident" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] diff --git a/crates/oyster_parser/Cargo.toml b/crates/oyster_parser/Cargo.toml index 94d887b..c7b6343 100644 --- a/crates/oyster_parser/Cargo.toml +++ b/crates/oyster_parser/Cargo.toml @@ -11,4 +11,4 @@ doctest = false thiserror = "^1.0.35" [dev-dependencies] -insta = "^1.15.0" +expect-test = "^1.4.0" diff --git a/crates/oyster_parser/tests/it/ast.rs b/crates/oyster_parser/tests/it/ast.rs index 9dcf1f2..b55081f 100644 --- a/crates/oyster_parser/tests/it/ast.rs +++ b/crates/oyster_parser/tests/it/ast.rs @@ -1,62 +1,219 @@ -use insta::assert_debug_snapshot as assert_snapshot; -use oyster_parser::{ast, ParseError}; +use expect_test::{expect, Expect}; +use oyster_parser::ast; -fn parse(s: &str) -> Result { - ast::Code::try_from(s) +fn check(s: &str, expect: Expect) { + let actual = ast::Code::try_from(s); + expect.assert_debug_eq(&actual); } #[test] fn empty() { - let source = ""; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "", + expect![[r#" + Ok( + Code( + [], + ), + ) + "#]], + ); } #[test] fn word() { - let source = "word"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "word", + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "word", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] fn word_with_escape() { - let source = r"hello\#world"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r"hello\#world", + expect![[r##" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello", + ), + Text( + "#", + ), + Text( + "world", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "##]], + ); } #[test] fn unicode() { - let source = "谚语"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "谚语", + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "谚语", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] fn simple_command() { - let source = "echo hi"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "echo hi", + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "echo", + ), + ], + ), + Word( + [ + Text( + "hi", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] fn semicolon() { - let source = "hello; hi"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "hello; hi", + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello", + ), + ], + ), + ], + None, + ), + ], + ), + ), + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hi", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] @@ -64,27 +221,94 @@ fn comment() { let source = r"# a # b"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Ok( + Code( + [], + ), + ) + "#]], + ); } #[test] fn inline_comment() { - let source = "whoami # hello"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami # hello", + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] fn pipeline() { - let source = "whoami | cat"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami | cat", + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + Stdout, + ), + Command( + [ + Word( + [ + Text( + "cat", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] @@ -92,9 +316,54 @@ fn multiline_pipeline() { let source = r"whoami | wc -l"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + Stdout, + ), + Command( + [ + Word( + [ + Text( + "wc", + ), + ], + ), + Word( + [ + Text( + "-l", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] @@ -102,9 +371,54 @@ fn comment_in_pipeline() { let source = r"whoami | # comment wc -l"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + Stdout, + ), + Command( + [ + Word( + [ + Text( + "wc", + ), + ], + ), + Word( + [ + Text( + "-l", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] @@ -112,72 +426,197 @@ fn reject_leading_pipe() { let source = r"whoami | cat"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Err( + UnexpectedPipe, + ) + "#]], + ); } #[test] fn reject_trailing_pipe() { - let source = "whoami |"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami |", + expect![[r#" + Err( + UnexpectedEof, + ) + "#]], + ); } #[test] fn reject_pipe_semicolon() { let source = "whoami | ; cat"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Err( + UnexpectedSemicolon, + ) + "#]], + ); } #[test] fn reject_double_pipe() { - let source = "whoami | | cat"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami | | cat", + expect![[r#" + Err( + UnexpectedPipe, + ) + "#]], + ); } #[test] fn double_quote_string() { - let source = r#""hello world""#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello world""#, + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello world", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] fn escaped_char_in_double_quotes() { - let source = r#""hello \" world""#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello \" world""#, + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello ", + ), + Text( + "\"", + ), + Text( + " world", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] fn unterminated_double_quotes() { - let source = r#""hello world"#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello world"#, + expect![[r#" + Err( + UnexpectedEof, + ) + "#]], + ); } #[test] fn command_substitution() { - let source = r#"echo (whoami)"#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#"echo (whoami)"#, + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "echo", + ), + ], + ), + Word( + [ + CommandSubstitution( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } #[test] @@ -185,7 +624,64 @@ fn quoted_command_substitution() { let source = r#"echo "(whoami) ""#; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Ok( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "echo", + ), + ], + ), + Word( + [ + CommandSubstitution( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ), + Text( + "\n ", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ) + "#]], + ); } diff --git a/crates/oyster_parser/tests/it/cst.rs b/crates/oyster_parser/tests/it/cst.rs index a4bdb40..359d2b4 100644 --- a/crates/oyster_parser/tests/it/cst.rs +++ b/crates/oyster_parser/tests/it/cst.rs @@ -1,62 +1,235 @@ -use insta::assert_debug_snapshot as assert_snapshot; +use expect_test::{expect, Expect}; use oyster_parser::ParseTree; -fn parse(s: &str) -> ParseTree { - ParseTree::from(s) +fn check(s: &str, expect: Expect) { + let actual = ParseTree::from(s); + expect.assert_debug_eq(&actual); } #[test] fn empty() { - let source = ""; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "", + expect![[r#" + Tree { + kind: Program, + children: [], + } + "#]], + ); } #[test] fn word() { - let source = "word"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "word", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 4, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn word_with_escape() { - let source = r"hello\#world"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r"hello\#world", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 5, + }, + Leaf { + kind: EscapedChar, + len: 2, + }, + Leaf { + kind: PlainText, + len: 5, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn unicode() { - let source = "谚语"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "谚语", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn simple_command() { - let source = "echo hi"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "echo hi", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 4, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 2, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn semicolon() { - let source = "hello; hi"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "hello; hi", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 5, + }, + ], + }, + ], + }, + ], + }, + Leaf { + kind: Semicolon, + len: 1, + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 2, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] @@ -64,27 +237,128 @@ fn comment() { let source = r"# a # b"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Tree { + kind: Program, + children: [ + Leaf { + kind: Comment, + len: 3, + }, + Leaf { + kind: Newlines, + len: 1, + }, + Leaf { + kind: Comment, + len: 3, + }, + ], + } + "#]], + ); } #[test] fn inline_comment() { - let source = "whoami # hello"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami # hello", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Leaf { + kind: Comment, + len: 7, + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn pipeline() { - let source = "whoami | cat"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami | cat", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + ], + }, + Leaf { + kind: Pipe, + len: 1, + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 3, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] @@ -92,9 +366,74 @@ fn multiline_pipeline() { let source = r"whoami | wc -l"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + ], + }, + Leaf { + kind: Pipe, + len: 1, + }, + Leaf { + kind: Newlines, + len: 1, + }, + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 2, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 2, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] @@ -102,9 +441,82 @@ fn comment_in_pipeline() { let source = r"whoami | # comment wc -l"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + ], + }, + Leaf { + kind: Pipe, + len: 1, + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Leaf { + kind: Comment, + len: 9, + }, + Leaf { + kind: Newlines, + len: 1, + }, + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 2, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 2, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] @@ -112,72 +524,472 @@ fn reject_leading_pipe() { let source = r"whoami | cat"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + ], + }, + ], + }, + Leaf { + kind: Newlines, + len: 1, + }, + Error { + kind: UnexpectedPipe, + len: 1, + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 3, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn reject_trailing_pipe() { - let source = "whoami |"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami |", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + ], + }, + Leaf { + kind: Pipe, + len: 1, + }, + Error { + kind: UnexpectedEof, + len: 0, + }, + ], + }, + ], + } + "#]], + ); } #[test] fn reject_pipe_semicolon() { let source = "whoami | ; cat"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + ], + }, + Leaf { + kind: Pipe, + len: 1, + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Error { + kind: UnexpectedSemicolon, + len: 1, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 3, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn reject_double_pipe() { - let source = "whoami | | cat"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami | | cat", + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + ], + }, + Leaf { + kind: Pipe, + len: 1, + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Error { + kind: UnexpectedPipe, + len: 1, + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 3, + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn double_quote_string() { - let source = r#""hello world""#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello world""#, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Tree { + kind: DQuotedString, + children: [ + Leaf { + kind: DoubleQuote, + len: 1, + }, + Leaf { + kind: PlainText, + len: 11, + }, + Leaf { + kind: DoubleQuote, + len: 1, + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn escaped_char_in_double_quotes() { - let source = r#""hello \" world""#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello \" world""#, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Tree { + kind: DQuotedString, + children: [ + Leaf { + kind: DoubleQuote, + len: 1, + }, + Leaf { + kind: PlainText, + len: 6, + }, + Leaf { + kind: EscapedChar, + len: 2, + }, + Leaf { + kind: PlainText, + len: 6, + }, + Leaf { + kind: DoubleQuote, + len: 1, + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn unterminated_double_quotes() { - let source = r#""hello world"#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello world"#, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Tree { + kind: DQuotedString, + children: [ + Leaf { + kind: DoubleQuote, + len: 1, + }, + Leaf { + kind: PlainText, + len: 11, + }, + Error { + kind: UnexpectedEof, + len: 0, + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] fn command_substitution() { - let source = r#"echo (whoami)"#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#"echo (whoami)"#, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 4, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Word, + children: [ + Tree { + kind: CommandSubstitution, + children: [ + Leaf { + kind: OpeningParenthesis, + len: 1, + }, + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + ], + }, + ], + }, + Leaf { + kind: ClosingParenthesis, + len: 1, + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } #[test] @@ -185,7 +997,91 @@ fn quoted_command_substitution() { let source = r#"echo "(whoami) ""#; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + Tree { + kind: Program, + children: [ + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 4, + }, + ], + }, + Leaf { + kind: Whitespace, + len: 1, + }, + Tree { + kind: Word, + children: [ + Tree { + kind: DQuotedString, + children: [ + Leaf { + kind: DoubleQuote, + len: 1, + }, + Tree { + kind: CommandSubstitution, + children: [ + Leaf { + kind: OpeningParenthesis, + len: 1, + }, + Tree { + kind: Pipeline, + children: [ + Tree { + kind: Command, + children: [ + Tree { + kind: Word, + children: [ + Leaf { + kind: PlainText, + len: 6, + }, + ], + }, + ], + }, + ], + }, + Leaf { + kind: ClosingParenthesis, + len: 1, + }, + ], + }, + Leaf { + kind: PlainText, + len: 9, + }, + Leaf { + kind: DoubleQuote, + len: 1, + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + } + "#]], + ); } diff --git a/crates/oyster_parser/tests/it/lexer.rs b/crates/oyster_parser/tests/it/lexer.rs index 92a2368..0b36446 100644 --- a/crates/oyster_parser/tests/it/lexer.rs +++ b/crates/oyster_parser/tests/it/lexer.rs @@ -1,155 +1,240 @@ -use insta::assert_debug_snapshot as assert_snapshot; +use expect_test::expect; use oyster_parser::Lexer; +macro_rules! check { + ($s:expr, $expect:expr, Command) => {{ + let actual = Lexer::new($s).next_command_token(); + $expect.assert_debug_eq(&actual); + }}; + ($s:expr, $expect:expr, String) => {{ + let actual = Lexer::new($s).next_string_token(); + let actual = format!("{:?}", actual); + $expect.assert_debug_eq(&actual); + }}; +} + #[test] fn eof() { - let source = ""; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + "", + expect![[r#" + Token { + kind: Eof, + len: 0, + } + "#]], + Command + ); } #[test] fn whitespace() { - let source = " \t \t\t"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + " \t \t\t", + expect![[r#" + Token { + kind: Whitespace, + len: 6, + } + "#]], + Command + ); } #[test] fn newlines() { - let source = "\n\n\n"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + "\n\n\n", + expect![[r#" + Token { + kind: Newlines, + len: 3, + } + "#]], + Command + ); } #[test] fn semicolon() { - let source = ";"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + ";", + expect![[r#" + Token { + kind: Semicolon, + len: 1, + } + "#]], + Command + ); } #[test] fn pipe() { - let source = "|"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + "|", + expect![[r#" + Token { + kind: Pipe, + len: 1, + } + "#]], + Command + ); } #[test] fn plain_word() { - let source = "whoami"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + "whoami", + expect![[r#" + Token { + kind: PlainText, + len: 6, + } + "#]], + Command + ); } #[test] fn word_with_hash() { - let source = "nixpkgs#hello"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + "nixpkgs#hello", + expect![[r#" + Token { + kind: PlainText, + len: 13, + } + "#]], + Command + ); } #[test] fn escaped_hash() { - let source = r"\#"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + r"\#", + expect![[r#" + Token { + kind: EscapedChar, + len: 2, + } + "#]], + Command + ); } #[test] fn comment() { - let source = "# hey"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + "# hey", + expect![[r#" + Token { + kind: Comment, + len: 5, + } + "#]], + Command + ); } #[test] fn double_quotes_in_command() { - let source = r#"""#; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + r#"""#, + expect![[r#" + Token { + kind: DoubleQuote, + len: 1, + } + "#]], + Command + ); } #[test] fn double_quotes_in_string() { - let source = r#"""#; - - let actual = Lexer::new(source).next_string_token(); - - assert_snapshot!(actual); + check!( + r#"""#, + expect![[r#" + "Token { kind: DoubleQuote, len: 1 }" + "#]], + String + ); } #[test] fn escaped_quotes_in_string() { - let source = r#"\""#; - - let actual = Lexer::new(source).next_string_token(); - - assert_snapshot!(actual); + check!( + r#"\""#, + expect![[r#" + "Token { kind: EscapedChar, len: 2 }" + "#]], + String + ); } #[test] fn opening_parenthesis_command_mode() { - let source = r"("; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + r"(", + expect![[r#" + Token { + kind: OpeningParenthesis, + len: 1, + } + "#]], + Command + ); } #[test] fn closing_parenthesis_command_mode() { - let source = r")"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + r")", + expect![[r#" + Token { + kind: ClosingParenthesis, + len: 1, + } + "#]], + Command + ); } #[test] fn opening_parenthesis_string_mode() { - let source = r"("; - - let actual = Lexer::new(source).next_string_token(); - - assert_snapshot!(actual); + check!( + r"(", + expect![[r#" + "Token { kind: OpeningParenthesis, len: 1 }" + "#]], + String + ); } #[test] fn closing_parenthesis_string_mode() { - let source = r")"; - - let actual = Lexer::new(source).next_string_token(); - - assert_snapshot!(actual); + check!( + r")", + expect![[r#" + "Token { kind: ClosingParenthesis, len: 1 }" + "#]], + String + ); } #[test] fn escape_newline() { - let source = "\\\n"; - - let actual = Lexer::new(source).next_command_token(); - - assert_snapshot!(actual); + check!( + "\\\n", + expect![[r#" + Token { + kind: Whitespace, + len: 2, + } + "#]], + Command + ); } diff --git a/crates/oyster_parser/tests/it/parser.rs b/crates/oyster_parser/tests/it/parser.rs index 159e05d..ea36ff9 100644 --- a/crates/oyster_parser/tests/it/parser.rs +++ b/crates/oyster_parser/tests/it/parser.rs @@ -1,62 +1,198 @@ -use insta::assert_debug_snapshot as assert_snapshot; -use oyster_parser::{ParseEvent, Parser}; +use expect_test::{expect, Expect}; +use oyster_parser::Parser; -fn parse(s: &str) -> Vec { - Parser::new(s).collect() +fn check(s: &str, expect: Expect) { + let actual = Parser::new(s).collect::>(); + expect.assert_debug_eq(&actual); } #[test] fn empty() { - let source = ""; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "", + expect![[r#" + [] + "#]], + ); } #[test] fn word() { - let source = "word"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "word", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn word_with_escape() { - let source = "hello\\world"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "hello\\world", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 5, + ), + NewLeaf( + EscapedChar, + 2, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn unicode() { - let source = "谚语"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "谚语", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn simple_command() { - let source = "echo hi"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "echo hi", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 2, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn semicolon() { - let source = "hello; hi"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "hello; hi", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 5, + ), + EndNode, + EndNode, + EndNode, + NewLeaf( + Semicolon, + 1, + ), + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 2, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] @@ -64,27 +200,111 @@ fn comment() { let source = r"# a # b"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + [ + NewLeaf( + Comment, + 3, + ), + NewLeaf( + Newlines, + 1, + ), + NewLeaf( + Comment, + 3, + ), + ] + "#]], + ); } #[test] fn inline_comment() { - let source = "whoami # hello"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami # hello", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + NewLeaf( + Comment, + 7, + ), + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn pipeline() { - let source = "whoami | cat"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami | cat", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + EndNode, + NewLeaf( + Pipe, + 1, + ), + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 3, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] @@ -92,9 +312,65 @@ fn multiline_pipeline() { let source = r"whoami | wc -l"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + EndNode, + NewLeaf( + Pipe, + 1, + ), + NewLeaf( + Newlines, + 1, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 2, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 2, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] @@ -102,9 +378,73 @@ fn comment_in_pipeline() { let source = r"whoami | # comment wc -l"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + EndNode, + NewLeaf( + Pipe, + 1, + ), + NewLeaf( + Whitespace, + 1, + ), + NewLeaf( + Comment, + 9, + ), + NewLeaf( + Newlines, + 1, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 2, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 2, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] @@ -112,72 +452,406 @@ fn reject_leading_pipe() { let source = r"whoami | cat"; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + EndNode, + EndNode, + NewLeaf( + Newlines, + 1, + ), + Error( + UnexpectedPipe, + 1, + ), + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 3, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn reject_trailing_pipe() { - let source = "whoami |"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami |", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + EndNode, + NewLeaf( + Pipe, + 1, + ), + Error( + UnexpectedEof, + 0, + ), + EndNode, + ] + "#]], + ); } #[test] fn reject_pipe_semicolon() { - let source = "whoami | ; cat"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami | ; cat", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + EndNode, + NewLeaf( + Pipe, + 1, + ), + NewLeaf( + Whitespace, + 1, + ), + Error( + UnexpectedSemicolon, + 1, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 3, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn reject_double_pipe() { - let source = "whoami | | cat"; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + "whoami | | cat", + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + EndNode, + NewLeaf( + Pipe, + 1, + ), + NewLeaf( + Whitespace, + 1, + ), + Error( + UnexpectedPipe, + 1, + ), + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 3, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn double_quote_string() { - let source = r#""hello world""#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello world""#, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + StartNode( + DQuotedString, + ), + NewLeaf( + DoubleQuote, + 1, + ), + NewLeaf( + PlainText, + 11, + ), + NewLeaf( + DoubleQuote, + 1, + ), + EndNode, + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn escaped_char_in_double_quotes() { - let source = r#""hello \" world""#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello \" world""#, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + StartNode( + DQuotedString, + ), + NewLeaf( + DoubleQuote, + 1, + ), + NewLeaf( + PlainText, + 6, + ), + NewLeaf( + EscapedChar, + 2, + ), + NewLeaf( + PlainText, + 6, + ), + NewLeaf( + DoubleQuote, + 1, + ), + EndNode, + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn unterminated_double_quotes() { - let source = r#""hello world"#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#""hello world"#, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + StartNode( + DQuotedString, + ), + NewLeaf( + DoubleQuote, + 1, + ), + NewLeaf( + PlainText, + 11, + ), + Error( + UnexpectedEof, + 0, + ), + EndNode, + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] fn command_substitution() { - let source = r#"echo (whoami)"#; - - let actual = parse(source); - - assert_snapshot!(actual); + check( + r#"echo (whoami)"#, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Word, + ), + StartNode( + CommandSubstitution, + ), + NewLeaf( + OpeningParenthesis, + 1, + ), + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + EndNode, + EndNode, + NewLeaf( + ClosingParenthesis, + 1, + ), + EndNode, + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } #[test] @@ -185,7 +859,79 @@ fn quoted_command_substitution() { let source = r#"echo "(whoami) ""#; - let actual = parse(source); - - assert_snapshot!(actual); + check( + source, + expect![[r#" + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Word, + ), + StartNode( + DQuotedString, + ), + NewLeaf( + DoubleQuote, + 1, + ), + StartNode( + CommandSubstitution, + ), + NewLeaf( + OpeningParenthesis, + 1, + ), + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + EndNode, + EndNode, + NewLeaf( + ClosingParenthesis, + 1, + ), + EndNode, + NewLeaf( + PlainText, + 9, + ), + NewLeaf( + DoubleQuote, + 1, + ), + EndNode, + EndNode, + EndNode, + EndNode, + ] + "#]], + ); } diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__command_substitution.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__command_substitution.snap deleted file mode 100644 index 2f6b4b8..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__command_substitution.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "echo", - ), - ], - ), - Word( - [ - CommandSubstitution( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__comment.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__comment.snap deleted file mode 100644 index c2e4091..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__comment.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__comment_in_pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__comment_in_pipeline.snap deleted file mode 100644 index 644d5e5..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__comment_in_pipeline.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - Stdout, - ), - Command( - [ - Word( - [ - Text( - "wc", - ), - ], - ), - Word( - [ - Text( - "-l", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__double_quote_string.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__double_quote_string.snap deleted file mode 100644 index 1aac750..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__double_quote_string.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello world", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__empty.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__empty.snap deleted file mode 100644 index c2e4091..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__empty.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__escaped_char_in_double_quotes.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__escaped_char_in_double_quotes.snap deleted file mode 100644 index bf3f7eb..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__escaped_char_in_double_quotes.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello ", - ), - Text( - "\"", - ), - Text( - " world", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__inline_comment.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__inline_comment.snap deleted file mode 100644 index 48f1338..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__inline_comment.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__multiline_pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__multiline_pipeline.snap deleted file mode 100644 index 644d5e5..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__multiline_pipeline.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - Stdout, - ), - Command( - [ - Word( - [ - Text( - "wc", - ), - ], - ), - Word( - [ - Text( - "-l", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__pipeline.snap deleted file mode 100644 index 4e80f91..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__pipeline.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - Stdout, - ), - Command( - [ - Word( - [ - Text( - "cat", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__quoted_command_substitution.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__quoted_command_substitution.snap deleted file mode 100644 index 0409c0b..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__quoted_command_substitution.snap +++ /dev/null @@ -1,59 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "echo", - ), - ], - ), - Word( - [ - CommandSubstitution( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), - ), - Text( - "\n ", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_double_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__reject_double_pipe.snap deleted file mode 100644 index c72f30e..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_double_pipe.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Err( - UnexpectedPipe, -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_leading_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__reject_leading_pipe.snap deleted file mode 100644 index c72f30e..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_leading_pipe.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Err( - UnexpectedPipe, -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_pipe_semicolon.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__reject_pipe_semicolon.snap deleted file mode 100644 index b220fdf..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_pipe_semicolon.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Err( - UnexpectedSemicolon, -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_trailing_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__reject_trailing_pipe.snap deleted file mode 100644 index 9254c8f..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__reject_trailing_pipe.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Err( - UnexpectedEof, -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__semicolon.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__semicolon.snap deleted file mode 100644 index 59764ca..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__semicolon.snap +++ /dev/null @@ -1,46 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello", - ), - ], - ), - ], - None, - ), - ], - ), - ), - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hi", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__simple_command.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__simple_command.snap deleted file mode 100644 index 1e82546..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__simple_command.snap +++ /dev/null @@ -1,35 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "echo", - ), - ], - ), - Word( - [ - Text( - "hi", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__unicode.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__unicode.snap deleted file mode 100644 index ea808e7..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__unicode.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "谚语", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__unterminated_double_quotes.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__unterminated_double_quotes.snap deleted file mode 100644 index 9254c8f..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__unterminated_double_quotes.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Err( - UnexpectedEof, -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__word.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__word.snap deleted file mode 100644 index d118100..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__word.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "word", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__ast__word_with_escape.snap b/crates/oyster_parser/tests/it/snapshots/it__ast__word_with_escape.snap deleted file mode 100644 index 578f4f6..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__ast__word_with_escape.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/ast.rs -expression: actual ---- -Ok( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello", - ), - Text( - "#", - ), - Text( - "world", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], - ), -) diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__command_substitution.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__command_substitution.snap deleted file mode 100644 index 577256e..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__command_substitution.snap +++ /dev/null @@ -1,69 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 4, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Word, - children: [ - Tree { - kind: CommandSubstitution, - children: [ - Leaf { - kind: OpeningParenthesis, - len: 1, - }, - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - ], - }, - ], - }, - Leaf { - kind: ClosingParenthesis, - len: 1, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__comment.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__comment.snap deleted file mode 100644 index 7fe4eee..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__comment.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Leaf { - kind: Comment, - len: 3, - }, - Leaf { - kind: Newlines, - len: 1, - }, - Leaf { - kind: Comment, - len: 3, - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__comment_in_pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__comment_in_pipeline.snap deleted file mode 100644 index e4be687..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__comment_in_pipeline.snap +++ /dev/null @@ -1,75 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - ], - }, - Leaf { - kind: Pipe, - len: 1, - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Leaf { - kind: Comment, - len: 9, - }, - Leaf { - kind: Newlines, - len: 1, - }, - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 2, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 2, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__double_quote_string.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__double_quote_string.snap deleted file mode 100644 index 37ac2c7..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__double_quote_string.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Tree { - kind: DQuotedString, - children: [ - Leaf { - kind: DoubleQuote, - len: 1, - }, - Leaf { - kind: PlainText, - len: 11, - }, - Leaf { - kind: DoubleQuote, - len: 1, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__empty.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__empty.snap deleted file mode 100644 index bb2c4c3..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__empty.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__escaped_char_in_double_quotes.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__escaped_char_in_double_quotes.snap deleted file mode 100644 index f7e7e49..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__escaped_char_in_double_quotes.snap +++ /dev/null @@ -1,49 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Tree { - kind: DQuotedString, - children: [ - Leaf { - kind: DoubleQuote, - len: 1, - }, - Leaf { - kind: PlainText, - len: 6, - }, - Leaf { - kind: EscapedChar, - len: 2, - }, - Leaf { - kind: PlainText, - len: 6, - }, - Leaf { - kind: DoubleQuote, - len: 1, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__inline_comment.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__inline_comment.snap deleted file mode 100644 index 086718c..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__inline_comment.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Leaf { - kind: Comment, - len: 7, - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__multiline_pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__multiline_pipeline.snap deleted file mode 100644 index cb1061b..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__multiline_pipeline.snap +++ /dev/null @@ -1,67 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - ], - }, - Leaf { - kind: Pipe, - len: 1, - }, - Leaf { - kind: Newlines, - len: 1, - }, - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 2, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 2, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__pipeline.snap deleted file mode 100644 index b628535..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__pipeline.snap +++ /dev/null @@ -1,54 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - ], - }, - Leaf { - kind: Pipe, - len: 1, - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 3, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__quoted_command_substitution.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__quoted_command_substitution.snap deleted file mode 100644 index d9d1587..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__quoted_command_substitution.snap +++ /dev/null @@ -1,86 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 4, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Word, - children: [ - Tree { - kind: DQuotedString, - children: [ - Leaf { - kind: DoubleQuote, - len: 1, - }, - Tree { - kind: CommandSubstitution, - children: [ - Leaf { - kind: OpeningParenthesis, - len: 1, - }, - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - ], - }, - ], - }, - Leaf { - kind: ClosingParenthesis, - len: 1, - }, - ], - }, - Leaf { - kind: PlainText, - len: 9, - }, - Leaf { - kind: DoubleQuote, - len: 1, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_double_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__reject_double_pipe.snap deleted file mode 100644 index 61ffaec..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_double_pipe.snap +++ /dev/null @@ -1,62 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - ], - }, - Leaf { - kind: Pipe, - len: 1, - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Error { - kind: UnexpectedPipe, - len: 1, - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 3, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_leading_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__reject_leading_pipe.snap deleted file mode 100644 index 6fd9e16..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_leading_pipe.snap +++ /dev/null @@ -1,59 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - ], - }, - ], - }, - Leaf { - kind: Newlines, - len: 1, - }, - Error { - kind: UnexpectedPipe, - len: 1, - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 3, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_pipe_semicolon.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__reject_pipe_semicolon.snap deleted file mode 100644 index 4c02141..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_pipe_semicolon.snap +++ /dev/null @@ -1,67 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - ], - }, - Leaf { - kind: Pipe, - len: 1, - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Error { - kind: UnexpectedSemicolon, - len: 1, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 3, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_trailing_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__reject_trailing_pipe.snap deleted file mode 100644 index 9412ebf..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__reject_trailing_pipe.snap +++ /dev/null @@ -1,40 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - ], - }, - Leaf { - kind: Pipe, - len: 1, - }, - Error { - kind: UnexpectedEof, - len: 0, - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__semicolon.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__semicolon.snap deleted file mode 100644 index fb16a3a..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__semicolon.snap +++ /dev/null @@ -1,55 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 5, - }, - ], - }, - ], - }, - ], - }, - Leaf { - kind: Semicolon, - len: 1, - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 2, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__simple_command.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__simple_command.snap deleted file mode 100644 index cc042e5..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__simple_command.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 4, - }, - ], - }, - Leaf { - kind: Whitespace, - len: 1, - }, - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 2, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__unicode.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__unicode.snap deleted file mode 100644 index 1b1d890..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__unicode.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 6, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__unterminated_double_quotes.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__unterminated_double_quotes.snap deleted file mode 100644 index 7378ebb..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__unterminated_double_quotes.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Tree { - kind: DQuotedString, - children: [ - Leaf { - kind: DoubleQuote, - len: 1, - }, - Leaf { - kind: PlainText, - len: 11, - }, - Error { - kind: UnexpectedEof, - len: 0, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__word.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__word.snap deleted file mode 100644 index 82c2595..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__word.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 4, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__cst__word_with_escape.snap b/crates/oyster_parser/tests/it/snapshots/it__cst__word_with_escape.snap deleted file mode 100644 index ceb21f2..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__cst__word_with_escape.snap +++ /dev/null @@ -1,36 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/cst.rs -expression: actual ---- -Tree { - kind: Program, - children: [ - Tree { - kind: Pipeline, - children: [ - Tree { - kind: Command, - children: [ - Tree { - kind: Word, - children: [ - Leaf { - kind: PlainText, - len: 5, - }, - Leaf { - kind: EscapedChar, - len: 2, - }, - Leaf { - kind: PlainText, - len: 5, - }, - ], - }, - ], - }, - ], - }, - ], -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__closing_parenthesis_command_mode.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__closing_parenthesis_command_mode.snap deleted file mode 100644 index 6a0bb26..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__closing_parenthesis_command_mode.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: ClosingParenthesis, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__closing_parenthesis_string_mode.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__closing_parenthesis_string_mode.snap deleted file mode 100644 index 6a0bb26..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__closing_parenthesis_string_mode.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: ClosingParenthesis, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__comment.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__comment.snap deleted file mode 100644 index 4b30a2c..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__comment.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: Comment, - len: 5, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__double_quotes_in_command.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__double_quotes_in_command.snap deleted file mode 100644 index 01bfb24..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__double_quotes_in_command.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: DoubleQuote, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__double_quotes_in_string.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__double_quotes_in_string.snap deleted file mode 100644 index 01bfb24..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__double_quotes_in_string.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: DoubleQuote, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__eof.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__eof.snap deleted file mode 100644 index a0bc053..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__eof.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: Eof, - len: 0, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__escape_newline.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__escape_newline.snap deleted file mode 100644 index 1fb4ba0..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__escape_newline.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: Whitespace, - len: 2, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__escaped_hash.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__escaped_hash.snap deleted file mode 100644 index b482977..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__escaped_hash.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: EscapedChar, - len: 2, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__escaped_quotes_in_string.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__escaped_quotes_in_string.snap deleted file mode 100644 index b482977..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__escaped_quotes_in_string.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: EscapedChar, - len: 2, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__newlines.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__newlines.snap deleted file mode 100644 index 4dc66fb..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__newlines.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: Newlines, - len: 3, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__opening_parenthesis_command_mode.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__opening_parenthesis_command_mode.snap deleted file mode 100644 index 6444cb7..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__opening_parenthesis_command_mode.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: OpeningParenthesis, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__opening_parenthesis_string_mode.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__opening_parenthesis_string_mode.snap deleted file mode 100644 index 6444cb7..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__opening_parenthesis_string_mode.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: OpeningParenthesis, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__pipe.snap deleted file mode 100644 index 367022a..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__pipe.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: Pipe, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__plain_word.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__plain_word.snap deleted file mode 100644 index 98a8540..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__plain_word.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: PlainText, - len: 6, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__semicolon.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__semicolon.snap deleted file mode 100644 index 1e2a05c..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__semicolon.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: Semicolon, - len: 1, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__whitespace.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__whitespace.snap deleted file mode 100644 index 7fc7390..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__whitespace.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: Whitespace, - len: 6, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__lexer__word_with_hash.snap b/crates/oyster_parser/tests/it/snapshots/it__lexer__word_with_hash.snap deleted file mode 100644 index 48a6b74..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__lexer__word_with_hash.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/lexer.rs -expression: actual ---- -Token { - kind: PlainText, - len: 13, -} diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__command_substitution.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__command_substitution.snap deleted file mode 100644 index 16d9289..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__command_substitution.snap +++ /dev/null @@ -1,58 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 4, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Word, - ), - StartNode( - CommandSubstitution, - ), - NewLeaf( - OpeningParenthesis, - 1, - ), - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - EndNode, - EndNode, - NewLeaf( - ClosingParenthesis, - 1, - ), - EndNode, - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__comment.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__comment.snap deleted file mode 100644 index ca14bcf..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__comment.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - NewLeaf( - Comment, - 3, - ), - NewLeaf( - Newlines, - 1, - ), - NewLeaf( - Comment, - 3, - ), -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__comment_in_pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__comment_in_pipeline.snap deleted file mode 100644 index d294b4d..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__comment_in_pipeline.snap +++ /dev/null @@ -1,66 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - EndNode, - NewLeaf( - Pipe, - 1, - ), - NewLeaf( - Whitespace, - 1, - ), - NewLeaf( - Comment, - 9, - ), - NewLeaf( - Newlines, - 1, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 2, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 2, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__double_quote_string.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__double_quote_string.snap deleted file mode 100644 index 06d445f..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__double_quote_string.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - StartNode( - DQuotedString, - ), - NewLeaf( - DoubleQuote, - 1, - ), - NewLeaf( - PlainText, - 11, - ), - NewLeaf( - DoubleQuote, - 1, - ), - EndNode, - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__empty.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__empty.snap deleted file mode 100644 index 53546c4..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__empty.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__escaped_char_in_double_quotes.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__escaped_char_in_double_quotes.snap deleted file mode 100644 index b7d4053..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__escaped_char_in_double_quotes.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - StartNode( - DQuotedString, - ), - NewLeaf( - DoubleQuote, - 1, - ), - NewLeaf( - PlainText, - 6, - ), - NewLeaf( - EscapedChar, - 2, - ), - NewLeaf( - PlainText, - 6, - ), - NewLeaf( - DoubleQuote, - 1, - ), - EndNode, - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__inline_comment.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__inline_comment.snap deleted file mode 100644 index bfab0d5..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__inline_comment.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - NewLeaf( - Comment, - 7, - ), - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__multiline_pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__multiline_pipeline.snap deleted file mode 100644 index ee6ebf5..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__multiline_pipeline.snap +++ /dev/null @@ -1,58 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - EndNode, - NewLeaf( - Pipe, - 1, - ), - NewLeaf( - Newlines, - 1, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 2, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 2, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__pipeline.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__pipeline.snap deleted file mode 100644 index 07a65ec..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__pipeline.snap +++ /dev/null @@ -1,46 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - EndNode, - NewLeaf( - Pipe, - 1, - ), - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 3, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__quoted_command_substitution.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__quoted_command_substitution.snap deleted file mode 100644 index a0e07c4..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__quoted_command_substitution.snap +++ /dev/null @@ -1,74 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 4, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Word, - ), - StartNode( - DQuotedString, - ), - NewLeaf( - DoubleQuote, - 1, - ), - StartNode( - CommandSubstitution, - ), - NewLeaf( - OpeningParenthesis, - 1, - ), - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - EndNode, - EndNode, - NewLeaf( - ClosingParenthesis, - 1, - ), - EndNode, - NewLeaf( - PlainText, - 9, - ), - NewLeaf( - DoubleQuote, - 1, - ), - EndNode, - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_double_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__reject_double_pipe.snap deleted file mode 100644 index 481e2a9..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_double_pipe.snap +++ /dev/null @@ -1,54 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - EndNode, - NewLeaf( - Pipe, - 1, - ), - NewLeaf( - Whitespace, - 1, - ), - Error( - UnexpectedPipe, - 1, - ), - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 3, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_leading_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__reject_leading_pipe.snap deleted file mode 100644 index cbf7e00..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_leading_pipe.snap +++ /dev/null @@ -1,50 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - EndNode, - EndNode, - NewLeaf( - Newlines, - 1, - ), - Error( - UnexpectedPipe, - 1, - ), - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 3, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_pipe_semicolon.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__reject_pipe_semicolon.snap deleted file mode 100644 index e1a585e..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_pipe_semicolon.snap +++ /dev/null @@ -1,58 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - EndNode, - NewLeaf( - Pipe, - 1, - ), - NewLeaf( - Whitespace, - 1, - ), - Error( - UnexpectedSemicolon, - 1, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 3, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_trailing_pipe.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__reject_trailing_pipe.snap deleted file mode 100644 index ab1c8b6..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__reject_trailing_pipe.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - EndNode, - NewLeaf( - Pipe, - 1, - ), - Error( - UnexpectedEof, - 0, - ), - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__semicolon.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__semicolon.snap deleted file mode 100644 index fed87e9..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__semicolon.snap +++ /dev/null @@ -1,46 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 5, - ), - EndNode, - EndNode, - EndNode, - NewLeaf( - Semicolon, - 1, - ), - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 2, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__simple_command.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__simple_command.snap deleted file mode 100644 index 977e8f8..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__simple_command.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 4, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 2, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__unicode.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__unicode.snap deleted file mode 100644 index ac786d8..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__unicode.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__unterminated_double_quotes.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__unterminated_double_quotes.snap deleted file mode 100644 index 4727dc1..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__unterminated_double_quotes.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - StartNode( - DQuotedString, - ), - NewLeaf( - DoubleQuote, - 1, - ), - NewLeaf( - PlainText, - 11, - ), - Error( - UnexpectedEof, - 0, - ), - EndNode, - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__word.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__word.snap deleted file mode 100644 index d05178c..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__word.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 4, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_parser/tests/it/snapshots/it__parser__word_with_escape.snap b/crates/oyster_parser/tests/it/snapshots/it__parser__word_with_escape.snap deleted file mode 100644 index dfc09d0..0000000 --- a/crates/oyster_parser/tests/it/snapshots/it__parser__word_with_escape.snap +++ /dev/null @@ -1,30 +0,0 @@ ---- -source: crates/oyster_parser/tests/it/parser.rs -expression: actual ---- -[ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 5, - ), - NewLeaf( - EscapedChar, - 2, - ), - NewLeaf( - PlainText, - 4, - ), - EndNode, - EndNode, - EndNode, -] diff --git a/crates/oyster_runtime/Cargo.toml b/crates/oyster_runtime/Cargo.toml index f20586e..bb8622a 100644 --- a/crates/oyster_runtime/Cargo.toml +++ b/crates/oyster_runtime/Cargo.toml @@ -18,4 +18,4 @@ default-features = false features = [ "fs", "ioctl", "process", "signal", "term" ] [dev-dependencies] -insta = "^1.15.0" +expect-test = "^1.4.0" diff --git a/crates/oyster_runtime/tests/it/pipeline.rs b/crates/oyster_runtime/tests/it/pipeline.rs index fe00e9f..aa3269f 100644 --- a/crates/oyster_runtime/tests/it/pipeline.rs +++ b/crates/oyster_runtime/tests/it/pipeline.rs @@ -1,6 +1,5 @@ use std::{ borrow::Cow, - env, ffi::{OsStr, OsString}, fs::File, io::{BufRead, BufReader, Write}, @@ -8,7 +7,7 @@ use std::{ process, }; -use insta::assert_debug_snapshot as assert_snapshot; +use expect_test::{expect, Expect}; use nix::{ ioctl_write_int_bad, libc, pty::{self, OpenptyResult}, @@ -16,6 +15,7 @@ use nix::{ unistd::{self, ForkResult}, }; use oyster_builtin_proc::builtin; +use oyster_parser::ast; use oyster_runtime::Shell; // TODO: test signal return codes @@ -68,6 +68,23 @@ where OsString::from_vec(buf[..buf.len() - 1].to_vec()) } +fn check_collect(ast: &ast::Code, expect: Expect) { + let actual = collect_output(|| { + let mut shell = Shell::new().unwrap(); + shell.run(ast).unwrap(); + }); + expect.assert_debug_eq(&actual); +} + +fn check_builtin(ast: &ast::Code, expect: Expect) { + let actual = collect_output(|| { + let mut shell = Shell::new().unwrap(); + shell.builtins_mut().add(test_builtin); + shell.run(ast).unwrap(); + }); + expect.assert_debug_eq(&actual); +} + #[test] fn simple_command() { let ast = { @@ -82,12 +99,12 @@ fn simple_command() { )]))]) }; - let actual = collect_output(|| { - let mut shell = Shell::new().unwrap(); - shell.run(&ast).unwrap(); - }); - - assert_snapshot!(actual); + check_collect( + &ast, + expect![[r#" + "hi\r\n" + "#]], + ); } #[test] @@ -113,12 +130,12 @@ fn pipeline() { ]))]) }; - let actual = collect_output(|| { - let mut shell = Shell::new().unwrap(); - shell.run(&ast).unwrap(); - }); - - assert_snapshot!(actual); + check_collect( + &ast, + expect![[r#" + "3\r\n" + "#]], + ); } #[test] @@ -136,7 +153,14 @@ fn command_not_found() { let mut shell = Shell::new().unwrap(); let actual = shell.run(&ast); - assert_snapshot!(actual); + let expect = expect![[r#" + Err( + CommandNotFound( + "this_command_doesnt_exist", + ), + ) + "#]]; + expect.assert_debug_eq(&actual); } #[test] @@ -153,7 +177,14 @@ fn permission_denied() { let mut shell = Shell::new().unwrap(); let actual = shell.run(&ast); - assert_snapshot!(actual); + let expect = expect![[r#" + Err( + PermissionDenied( + "/", + ), + ) + "#]]; + expect.assert_debug_eq(&actual); } #[test] @@ -170,12 +201,12 @@ fn multipart_word() { )]))]) }; - let actual = collect_output(|| { - let mut shell = Shell::new().unwrap(); - shell.run(&ast).unwrap(); - }); - - assert_snapshot!(actual); + check_collect( + &ast, + expect![[r#" + "hello\r\n" + "#]], + ); } #[test] @@ -189,13 +220,12 @@ fn simple_builtin() { )]))]) }; - let actual = collect_output(|| { - let mut shell = Shell::new().unwrap(); - shell.builtins_mut().add(test_builtin); - shell.run(&ast).unwrap(); - }); - - assert_snapshot!(actual); + check_builtin( + &ast, + expect![[r#" + "this is a test\r\n" + "#]], + ); } #[test] @@ -218,13 +248,12 @@ fn builtin_redirection() { ]))]) }; - let actual = collect_output(|| { - let mut shell = Shell::new().unwrap(); - shell.builtins_mut().add(test_builtin); - shell.run(&ast).unwrap(); - }); - - assert_snapshot!(actual); + check_builtin( + &ast, + expect![[r#" + "15\r\n" + "#]], + ); } #[test] @@ -249,11 +278,10 @@ fn command_substitution() { )]))]) }; - let actual = collect_output(|| { - let mut shell = Shell::new().unwrap(); - shell.builtins_mut().add(test_builtin); - shell.run(&ast).unwrap(); - }); - - assert_snapshot!(actual); + check_builtin( + &ast, + expect![[r#" + "hello\r\n" + "#]], + ); } diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__builtin_redirection.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__builtin_redirection.snap deleted file mode 100644 index 351b518..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__builtin_redirection.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -"15\r\n" diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__command_not_found.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__command_not_found.snap deleted file mode 100644 index e86a398..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__command_not_found.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -Err( - CommandNotFound( - "this_command_doesnt_exist", - ), -) diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__command_substitution.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__command_substitution.snap deleted file mode 100644 index 17df64b..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__command_substitution.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -"hello\r\n" diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__multipart_word.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__multipart_word.snap deleted file mode 100644 index 17df64b..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__multipart_word.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -"hello\r\n" diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__permission_denied.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__permission_denied.snap deleted file mode 100644 index ea33113..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__permission_denied.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -Err( - PermissionDenied( - "/", - ), -) diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__pipeline.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__pipeline.snap deleted file mode 100644 index 24bbfba..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__pipeline.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -"3\r\n" diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__simple_builtin.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__simple_builtin.snap deleted file mode 100644 index 7ad9b91..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__simple_builtin.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -"this is a test\r\n" diff --git a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__simple_command.snap b/crates/oyster_runtime/tests/it/snapshots/it__pipeline__simple_command.snap deleted file mode 100644 index b3c9645..0000000 --- a/crates/oyster_runtime/tests/it/snapshots/it__pipeline__simple_command.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/oyster_runtime/tests/it/pipeline.rs -expression: actual ---- -"hi\r\n" diff --git a/flake.nix b/flake.nix index 7cc2a29..a455eca 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,6 @@ devShell = pkgs.mkShell { nativeBuildInputs = with pkgs; [ - cargo-insta toolchain ]; };