From a52431cd6ff4055174ea7bdb7b4f5bc85617cc19 Mon Sep 17 00:00:00 2001 From: Niols Date: Mon, 19 Jun 2023 02:01:04 +0200 Subject: [PATCH] Fix expectations of corresponding tests --- .../alias-alias.t/expected.json | 38 +---- .../alias-commands-words-only.t/expected.json | 19 +-- .../alias-cycle.t/expected.json | 29 +--- .../alias-mixed-arguments.t/expected.json | 76 +-------- .../alias-multiple-arguments.t/expected.json | 57 +------ .../expected.json | 58 ++----- .../toplevel-alias.t/expected.json | 19 +-- .../toplevel-unalias.t/expected.json | 29 +--- .../unalias-a.t/expected.json | 38 +---- .../expected.json | 38 +---- .../2.6.1-tilde-prefix/login.t/expected.json | 160 +----------------- .../assignment-words.t/expected.json | 19 +-- .../expected.json | 19 +-- .../good/assignment-empty.t/expected.json | 17 +- .../good/assignment-eof.t/expected.json | 19 +-- 15 files changed, 89 insertions(+), 546 deletions(-) diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-alias.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-alias.t/expected.json index be5daab1..2e093a7d 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-alias.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-alias.t/expected.json @@ -43,23 +43,8 @@ "rename=alias", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "rename" - ], - [ - "Word", - "alias", - [ - [ - "WordLiteral", - "alias" - ] - ] - ] - ] + "WordLiteral", + "rename=alias" ] ] ] @@ -109,23 +94,8 @@ "time=date", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "time" - ], - [ - "Word", - "date", - [ - [ - "WordLiteral", - "date" - ] - ] - ] - ] + "WordLiteral", + "time=date" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-commands-words-only.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-commands-words-only.t/expected.json index c8e0f16c..b8e985d8 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-commands-words-only.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-commands-words-only.t/expected.json @@ -41,23 +41,8 @@ "show=echo", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "show" - ], - [ - "Word", - "echo", - [ - [ - "WordLiteral", - "echo" - ] - ] - ] - ] + "WordLiteral", + "show=echo" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-cycle.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-cycle.t/expected.json index 282ecbd7..e4727db4 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-cycle.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-cycle.t/expected.json @@ -41,29 +41,18 @@ "ls='ls -h -t -l'", [ [ - "WordAssignmentWord", + "WordLiteral", + "ls=" + ], + [ + "WordSingleQuoted", [ + "Word", + "ls -h -t -l", [ - "Name", - "ls" - ], - [ - "Word", - "'ls -h -t -l'", [ - [ - "WordSingleQuoted", - [ - "Word", - "ls -h -t -l", - [ - [ - "WordLiteral", - "ls -h -t -l" - ] - ] - ] - ] + "WordLiteral", + "ls -h -t -l" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-mixed-arguments.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-mixed-arguments.t/expected.json index 29d0bc81..18253396 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-mixed-arguments.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-mixed-arguments.t/expected.json @@ -45,23 +45,8 @@ "titi=TITI", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "titi" - ], - [ - "Word", - "TITI", - [ - [ - "WordLiteral", - "TITI" - ] - ] - ] - ] + "WordLiteral", + "titi=TITI" ] ] ] @@ -71,23 +56,8 @@ "toto=TOTO", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "toto" - ], - [ - "Word", - "TOTO", - [ - [ - "WordLiteral", - "TOTO" - ] - ] - ] - ] + "WordLiteral", + "toto=TOTO" ] ] ] @@ -143,23 +113,8 @@ "tata=TATA", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "tata" - ], - [ - "Word", - "TATA", - [ - [ - "WordLiteral", - "TATA" - ] - ] - ] - ] + "WordLiteral", + "tata=TATA" ] ] ] @@ -180,23 +135,8 @@ "tutu=TUTU", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "tutu" - ], - [ - "Word", - "TUTU", - [ - [ - "WordLiteral", - "TUTU" - ] - ] - ] - ] + "WordLiteral", + "tutu=TUTU" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-multiple-arguments.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-multiple-arguments.t/expected.json index 720eeece..c7c330e6 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-multiple-arguments.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-multiple-arguments.t/expected.json @@ -47,23 +47,8 @@ "show=echo", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "show" - ], - [ - "Word", - "echo", - [ - [ - "WordLiteral", - "echo" - ] - ] - ] - ] + "WordLiteral", + "show=echo" ] ] ] @@ -73,23 +58,8 @@ "list=ls", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "list" - ], - [ - "Word", - "ls", - [ - [ - "WordLiteral", - "ls" - ] - ] - ] - ] + "WordLiteral", + "list=ls" ] ] ] @@ -99,23 +69,8 @@ "coocoo=kiki", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "coocoo" - ], - [ - "Word", - "kiki", - [ - [ - "WordLiteral", - "kiki" - ] - ] - ] - ] + "WordLiteral", + "coocoo=kiki" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-with-final-whitespace.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-with-final-whitespace.t/expected.json index b851b910..42f92299 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-with-final-whitespace.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/alias-with-final-whitespace.t/expected.json @@ -51,29 +51,18 @@ "x='echo '", [ [ - "WordAssignmentWord", + "WordLiteral", + "x=" + ], + [ + "WordSingleQuoted", [ + "Word", + "echo ", [ - "Name", - "x" - ], - [ - "Word", - "'echo '", [ - [ - "WordSingleQuoted", - [ - "Word", - "echo ", - [ - [ - "WordLiteral", - "echo " - ] - ] - ] - ] + "WordLiteral", + "echo " ] ] ] @@ -126,29 +115,18 @@ "z='a '", [ [ - "WordAssignmentWord", + "WordLiteral", + "z=" + ], + [ + "WordSingleQuoted", [ + "Word", + "a ", [ - "Name", - "z" - ], - [ - "Word", - "'a '", [ - [ - "WordSingleQuoted", - [ - "Word", - "a ", - [ - [ - "WordLiteral", - "a " - ] - ] - ] - ] + "WordLiteral", + "a " ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-alias.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-alias.t/expected.json index e3d7aba7..e690e320 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-alias.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-alias.t/expected.json @@ -41,23 +41,8 @@ "foo=for", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "foo" - ], - [ - "Word", - "for", - [ - [ - "WordLiteral", - "for" - ] - ] - ] - ] + "WordLiteral", + "foo=for" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-unalias.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-unalias.t/expected.json index d8b65c81..5eb2844e 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-unalias.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/toplevel-unalias.t/expected.json @@ -45,29 +45,18 @@ "foo='ls -l'", [ [ - "WordAssignmentWord", + "WordLiteral", + "foo=" + ], + [ + "WordSingleQuoted", [ + "Word", + "ls -l", [ - "Name", - "foo" - ], - [ - "Word", - "'ls -l'", [ - [ - "WordSingleQuoted", - [ - "Word", - "ls -l", - [ - [ - "WordLiteral", - "ls -l" - ] - ] - ] - ] + "WordLiteral", + "ls -l" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-a.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-a.t/expected.json index cc6b4098..4669fea5 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-a.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-a.t/expected.json @@ -47,23 +47,8 @@ "tata=TATA", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "tata" - ], - [ - "Word", - "TATA", - [ - [ - "WordLiteral", - "TATA" - ] - ] - ] - ] + "WordLiteral", + "tata=TATA" ] ] ] @@ -73,23 +58,8 @@ "titi=TITI", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "titi" - ], - [ - "Word", - "TITI", - [ - [ - "WordLiteral", - "TITI" - ] - ] - ] - ] + "WordLiteral", + "titi=TITI" ] ] ] diff --git a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-multiple-arguments.t/expected.json b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-multiple-arguments.t/expected.json index 9409c445..ea4a49f0 100644 --- a/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-multiple-arguments.t/expected.json +++ b/tests/golden/good/2.3-token-recognition/2.3.1-alias-substitution/unalias-multiple-arguments.t/expected.json @@ -45,23 +45,8 @@ "show=echo", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "show" - ], - [ - "Word", - "echo", - [ - [ - "WordLiteral", - "echo" - ] - ] - ] - ] + "WordLiteral", + "show=echo" ] ] ] @@ -111,23 +96,8 @@ "list=ls", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "list" - ], - [ - "Word", - "ls", - [ - [ - "WordLiteral", - "ls" - ] - ] - ] - ] + "WordLiteral", + "list=ls" ] ] ] diff --git a/tests/golden/good/2.6-word-expansions/2.6.1-tilde-prefix/login.t/expected.json b/tests/golden/good/2.6-word-expansions/2.6.1-tilde-prefix/login.t/expected.json index c42bc96a..db92714c 100644 --- a/tests/golden/good/2.6-word-expansions/2.6.1-tilde-prefix/login.t/expected.json +++ b/tests/golden/good/2.6-word-expansions/2.6.1-tilde-prefix/login.t/expected.json @@ -537,27 +537,8 @@ "W=~knuth/foo/bar", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "W" - ], - [ - "Word", - "~knuth/foo/bar", - [ - [ - "WordTildePrefix", - "knuth" - ], - [ - "WordLiteral", - "/foo/bar" - ] - ] - ] - ] + "WordLiteral", + "W=~knuth/foo/bar" ] ] ] @@ -607,47 +588,8 @@ "X=~kn:~/bin:~darkvador/secret", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "X" - ], - [ - "Word", - "~kn:~/bin:~darkvador/secret", - [ - [ - "WordTildePrefix", - "kn" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordTildePrefix", - "" - ], - [ - "WordLiteral", - "/bin" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordTildePrefix", - "darkvador" - ], - [ - "WordLiteral", - "/secret" - ] - ] - ] - ] + "WordLiteral", + "X=~kn:~/bin:~darkvador/secret" ] ] ] @@ -697,51 +639,8 @@ "Y=~kn:/bonjour:~/bonsoir:and/this/one", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "Y" - ], - [ - "Word", - "~kn:/bonjour:~/bonsoir:and/this/one", - [ - [ - "WordTildePrefix", - "kn" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordLiteral", - "/bonjour" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordTildePrefix", - "" - ], - [ - "WordLiteral", - "/bonsoir" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordLiteral", - "and/this/one" - ] - ] - ] - ] + "WordLiteral", + "Y=~kn:/bonjour:~/bonsoir:and/this/one" ] ] ] @@ -791,51 +690,8 @@ "Z=/bonjour:~kn:~/bonsoir:and/this/one", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "Z" - ], - [ - "Word", - "/bonjour:~kn:~/bonsoir:and/this/one", - [ - [ - "WordLiteral", - "/bonjour" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordTildePrefix", - "kn" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordTildePrefix", - "" - ], - [ - "WordLiteral", - "/bonsoir" - ], - [ - "WordLiteral", - ":" - ], - [ - "WordLiteral", - "and/this/one" - ] - ] - ] - ] + "WordLiteral", + "Z=/bonjour:~kn:~/bonsoir:and/this/one" ] ] ] diff --git a/tests/golden/good/2.9-shell-commands/2.9.1-simple-commands/assignment-words.t/expected.json b/tests/golden/good/2.9-shell-commands/2.9.1-simple-commands/assignment-words.t/expected.json index 68e65130..a7afd56b 100644 --- a/tests/golden/good/2.9-shell-commands/2.9.1-simple-commands/assignment-words.t/expected.json +++ b/tests/golden/good/2.9-shell-commands/2.9.1-simple-commands/assignment-words.t/expected.json @@ -102,23 +102,8 @@ "CC=cc", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "CC" - ], - [ - "Word", - "cc", - [ - [ - "WordLiteral", - "cc" - ] - ] - ] - ] + "WordLiteral", + "CC=cc" ] ] ] diff --git a/tests/golden/good/2.9-shell-commands/2.9.4-compound-commands/for/for-assignment-in-wordlist.t/expected.json b/tests/golden/good/2.9-shell-commands/2.9.4-compound-commands/for/for-assignment-in-wordlist.t/expected.json index 382f1c85..18df0454 100644 --- a/tests/golden/good/2.9-shell-commands/2.9.4-compound-commands/for/for-assignment-in-wordlist.t/expected.json +++ b/tests/golden/good/2.9-shell-commands/2.9.4-compound-commands/for/for-assignment-in-wordlist.t/expected.json @@ -35,23 +35,8 @@ "BOOT_START=start_on_boot", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "BOOT_START" - ], - [ - "Word", - "start_on_boot", - [ - [ - "WordLiteral", - "start_on_boot" - ] - ] - ] - ] + "WordLiteral", + "BOOT_START=start_on_boot" ] ] ] diff --git a/tests/golden/good/assignment-empty.t/expected.json b/tests/golden/good/assignment-empty.t/expected.json index 34376ddb..bfa5d6f6 100644 --- a/tests/golden/good/assignment-empty.t/expected.json +++ b/tests/golden/good/assignment-empty.t/expected.json @@ -18,17 +18,18 @@ [ "Command_SimpleCommand", [ - "SimpleCommand_CmdName", + "SimpleCommand_CmdPrefix", [ - "CmdName_Word", + "CmdPrefix_AssignmentWord", [ - "Word", - "A=", [ - [ - "WordLiteral", - "A=" - ] + "Name", + "A" + ], + [ + "Word", + "", + [] ] ] ] diff --git a/tests/golden/good/assignment-eof.t/expected.json b/tests/golden/good/assignment-eof.t/expected.json index 07d03e5e..f14e2bb4 100644 --- a/tests/golden/good/assignment-eof.t/expected.json +++ b/tests/golden/good/assignment-eof.t/expected.json @@ -39,23 +39,8 @@ "b=c", [ [ - "WordAssignmentWord", - [ - [ - "Name", - "b" - ], - [ - "Word", - "c", - [ - [ - "WordLiteral", - "c" - ] - ] - ] - ] + "WordLiteral", + "b=c" ] ] ]