From 87b911183c06348c38a110d3734b3ed0940d5676 Mon Sep 17 00:00:00 2001 From: Charlotte Meyer Date: Sat, 5 Nov 2022 13:32:38 +0000 Subject: [PATCH] style(tests): fix indentation in expect blocks Signed-off-by: Charlotte Meyer --- crates/oyster_parser/tests/it/ast.rs | 938 +++++++-------- crates/oyster_parser/tests/it/lexer.rs | 40 +- crates/oyster_parser/tests/it/parser.rs | 1008 ++++++++--------- .../oyster_runtime/tests/it/builtins/mod.rs | 8 +- crates/oyster_runtime/tests/it/pipeline.rs | 8 +- 5 files changed, 1001 insertions(+), 1001 deletions(-) diff --git a/crates/oyster_parser/tests/it/ast.rs b/crates/oyster_parser/tests/it/ast.rs index b55081f..8095558 100644 --- a/crates/oyster_parser/tests/it/ast.rs +++ b/crates/oyster_parser/tests/it/ast.rs @@ -11,12 +11,12 @@ fn empty() { check( "", expect![[r#" - Ok( - Code( - [], - ), - ) - "#]], + Ok( + Code( + [], + ), + ) + "#]], ); } @@ -25,31 +25,31 @@ fn word() { check( "word", expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "word", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "word", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -58,37 +58,37 @@ fn word_with_escape() { check( r"hello\#world", expect![[r##" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello", - ), - Text( - "#", - ), - Text( - "world", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello", + ), + Text( + "#", + ), + Text( + "world", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "##]], + ], + ), + ) + "##]], ); } @@ -97,31 +97,31 @@ fn unicode() { check( "谚语", expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "谚语", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "谚语", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -130,38 +130,38 @@ fn simple_command() { check( "echo hi", expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "echo", - ), - ], - ), - Word( - [ - Text( - "hi", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "echo", + ), + ], + ), + Word( + [ + Text( + "hi", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -170,49 +170,49 @@ fn semicolon() { check( "hello; hi", expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - Pipeline( Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hi", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hi", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -224,12 +224,12 @@ fn comment() { check( source, expect![[r#" - Ok( - Code( - [], - ), - ) - "#]], + Ok( + Code( + [], + ), + ) + "#]], ); } @@ -238,31 +238,31 @@ fn inline_comment() { check( "whoami # hello", expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -271,43 +271,43 @@ fn pipeline() { check( "whoami | cat", expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - Stdout, - ), - Command( - [ - Word( - [ - Text( - "cat", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + Stdout, + ), + Command( + [ + Word( + [ + Text( + "cat", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -319,50 +319,50 @@ wc -l"; check( source, expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - Stdout, - ), - Command( - [ - Word( - [ - Text( - "wc", - ), - ], - ), - Word( - [ - Text( - "-l", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + Stdout, + ), + Command( + [ + Word( + [ + Text( + "wc", + ), + ], + ), + Word( + [ + Text( + "-l", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -374,50 +374,50 @@ wc -l"; check( source, expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - Stdout, - ), - Command( - [ - Word( - [ - Text( - "wc", - ), - ], - ), - Word( - [ - Text( - "-l", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + Stdout, + ), + Command( + [ + Word( + [ + Text( + "wc", + ), + ], + ), + Word( + [ + Text( + "-l", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -429,10 +429,10 @@ fn reject_leading_pipe() { check( source, expect![[r#" - Err( - UnexpectedPipe, - ) - "#]], + Err( + UnexpectedPipe, + ) + "#]], ); } @@ -455,10 +455,10 @@ fn reject_pipe_semicolon() { check( source, expect![[r#" - Err( - UnexpectedSemicolon, - ) - "#]], + Err( + UnexpectedSemicolon, + ) + "#]], ); } @@ -467,10 +467,10 @@ fn reject_double_pipe() { check( "whoami | | cat", expect![[r#" - Err( - UnexpectedPipe, - ) - "#]], + Err( + UnexpectedPipe, + ) + "#]], ); } @@ -479,31 +479,31 @@ fn double_quote_string() { check( r#""hello world""#, expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello world", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello world", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -512,37 +512,37 @@ fn escaped_char_in_double_quotes() { check( r#""hello \" world""#, expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "hello ", - ), - Text( - "\"", - ), - Text( - " world", - ), - ], - ), - ], - None, - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "hello ", + ), + Text( + "\"", + ), + Text( + " world", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -551,10 +551,10 @@ fn unterminated_double_quotes() { check( r#""hello world"#, expect![[r#" - Err( - UnexpectedEof, - ) - "#]], + Err( + UnexpectedEof, + ) + "#]], ); } @@ -563,59 +563,59 @@ fn command_substitution() { check( r#"echo (whoami)"#, expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "echo", - ), - ], - ), - Word( - [ - CommandSubstitution( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "echo", ), - ), - ], - ), - ], - None, - ), - ], + ], + ), + Word( + [ + CommandSubstitution( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } @@ -627,61 +627,61 @@ fn quoted_command_substitution() { check( source, expect![[r#" - Ok( - Code( - [ - Pipeline( + Ok( + Code( + [ Pipeline( - [ - Command( - [ - Word( - [ - Text( - "echo", - ), - ], - ), - Word( - [ - CommandSubstitution( - Code( - [ - Pipeline( - Pipeline( - [ - Command( - [ - Word( - [ - Text( - "whoami", - ), - ], - ), - ], - None, - ), - ], - ), - ), - ], + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "echo", ), - ), - Text( - "\n ", - ), - ], - ), - ], - None, - ), - ], + ], + ), + Word( + [ + CommandSubstitution( + Code( + [ + Pipeline( + Pipeline( + [ + Command( + [ + Word( + [ + Text( + "whoami", + ), + ], + ), + ], + None, + ), + ], + ), + ), + ], + ), + ), + Text( + "\n ", + ), + ], + ), + ], + None, + ), + ], + ), ), - ), - ], - ), - ) - "#]], + ], + ), + ) + "#]], ); } diff --git a/crates/oyster_parser/tests/it/lexer.rs b/crates/oyster_parser/tests/it/lexer.rs index 0b36446..3379c88 100644 --- a/crates/oyster_parser/tests/it/lexer.rs +++ b/crates/oyster_parser/tests/it/lexer.rs @@ -18,11 +18,11 @@ fn eof() { check!( "", expect![[r#" - Token { - kind: Eof, - len: 0, - } - "#]], + Token { + kind: Eof, + len: 0, + } + "#]], Command ); } @@ -60,11 +60,11 @@ fn semicolon() { check!( ";", expect![[r#" - Token { - kind: Semicolon, - len: 1, - } - "#]], + Token { + kind: Semicolon, + len: 1, + } + "#]], Command ); } @@ -74,11 +74,11 @@ fn pipe() { check!( "|", expect![[r#" - Token { - kind: Pipe, - len: 1, - } - "#]], + Token { + kind: Pipe, + len: 1, + } + "#]], Command ); } @@ -130,11 +130,11 @@ fn comment() { check!( "# hey", expect![[r#" - Token { - kind: Comment, - len: 5, - } - "#]], + Token { + kind: Comment, + len: 5, + } + "#]], Command ); } diff --git a/crates/oyster_parser/tests/it/parser.rs b/crates/oyster_parser/tests/it/parser.rs index ea36ff9..1b28e10 100644 --- a/crates/oyster_parser/tests/it/parser.rs +++ b/crates/oyster_parser/tests/it/parser.rs @@ -11,8 +11,8 @@ fn empty() { check( "", expect![[r#" - [] - "#]], + [] + "#]], ); } @@ -21,25 +21,25 @@ fn word() { check( "word", expect![[r#" - [ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 4, - ), - EndNode, - EndNode, - EndNode, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], ); } @@ -48,33 +48,33 @@ fn word_with_escape() { check( "hello\\world", expect![[r#" - [ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 5, - ), - NewLeaf( - EscapedChar, - 2, - ), - NewLeaf( - PlainText, - 4, - ), - EndNode, - EndNode, - EndNode, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 5, + ), + NewLeaf( + EscapedChar, + 2, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], ); } @@ -83,25 +83,25 @@ fn unicode() { check( "谚语", expect![[r#" - [ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - EndNode, - EndNode, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], ); } @@ -110,37 +110,37 @@ fn simple_command() { 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, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 4, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 2, + ), + EndNode, + EndNode, + EndNode, + ] + "#]], ); } @@ -149,49 +149,49 @@ fn semicolon() { 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, - ] - "#]], + [ + 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, + ] + "#]], ); } @@ -226,33 +226,33 @@ fn inline_comment() { check( "whoami # hello", expect![[r#" - [ - StartNode( - Pipeline, - ), - StartNode( - Command, - ), - StartNode( - Word, - ), - NewLeaf( - PlainText, - 6, - ), - EndNode, - NewLeaf( - Whitespace, - 1, - ), - NewLeaf( - Comment, - 7, - ), - EndNode, - EndNode, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + NewLeaf( + Comment, + 7, + ), + EndNode, + EndNode, + ] + "#]], ); } @@ -261,49 +261,49 @@ fn pipeline() { 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, - ] - "#]], + [ + 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, + ] + "#]], ); } @@ -510,37 +510,37 @@ fn reject_trailing_pipe() { 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, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + NewLeaf( + PlainText, + 6, + ), + EndNode, + NewLeaf( + Whitespace, + 1, + ), + EndNode, + NewLeaf( + Pipe, + 1, + ), + Error( + UnexpectedEof, + 0, + ), + EndNode, + ] + "#]], ); } @@ -549,61 +549,61 @@ fn reject_pipe_semicolon() { 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, - ] - "#]], + [ + 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, + ] + "#]], ); } @@ -612,57 +612,57 @@ fn reject_double_pipe() { 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, - ] - "#]], + [ + 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, + ] + "#]], ); } @@ -671,37 +671,37 @@ fn double_quote_string() { 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, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + StartNode( + DQuotedString, + ), + NewLeaf( + DoubleQuote, + 1, + ), + NewLeaf( + PlainText, + 11, + ), + NewLeaf( + DoubleQuote, + 1, + ), + EndNode, + EndNode, + EndNode, + EndNode, + ] + "#]], ); } @@ -710,45 +710,45 @@ fn escaped_char_in_double_quotes() { 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, - ] - "#]], + [ + 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, + ] + "#]], ); } @@ -757,37 +757,37 @@ fn unterminated_double_quotes() { 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, - ] - "#]], + [ + StartNode( + Pipeline, + ), + StartNode( + Command, + ), + StartNode( + Word, + ), + StartNode( + DQuotedString, + ), + NewLeaf( + DoubleQuote, + 1, + ), + NewLeaf( + PlainText, + 11, + ), + Error( + UnexpectedEof, + 0, + ), + EndNode, + EndNode, + EndNode, + EndNode, + ] + "#]], ); } @@ -796,61 +796,61 @@ fn command_substitution() { 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, - ] - "#]], + [ + 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_runtime/tests/it/builtins/mod.rs b/crates/oyster_runtime/tests/it/builtins/mod.rs index a064e79..01ddb86 100644 --- a/crates/oyster_runtime/tests/it/builtins/mod.rs +++ b/crates/oyster_runtime/tests/it/builtins/mod.rs @@ -38,8 +38,8 @@ fn simple_builtin() { check( &ast, expect![[r#" - "this is a test\r\n" - "#]], + "this is a test\r\n" + "#]], ); } @@ -66,7 +66,7 @@ fn builtin_redirection() { check( &ast, expect![[r#" - "15\r\n" - "#]], + "15\r\n" + "#]], ); } diff --git a/crates/oyster_runtime/tests/it/pipeline.rs b/crates/oyster_runtime/tests/it/pipeline.rs index 7093b25..32e97bc 100644 --- a/crates/oyster_runtime/tests/it/pipeline.rs +++ b/crates/oyster_runtime/tests/it/pipeline.rs @@ -31,8 +31,8 @@ fn simple_command() { check( &ast, expect![[r#" - "hi\r\n" - "#]], + "hi\r\n" + "#]], ); } @@ -163,7 +163,7 @@ fn command_substitution() { check( &ast, expect![[r#" - "hello\r\n" - "#]], + "hello\r\n" + "#]], ); }