Browse Source

[enh] add unit tests for coted blocks.

Moul 4 years ago
parent
commit
799a795f53
1 changed files with 17 additions and 0 deletions
  1. 17 0
      tests.sh

+ 17 - 0
tests.sh

@@ -114,6 +114,23 @@ tests=(
 "echo test2>&1 toto"
 "echo test2>&1toto; rm 1toto" # zsh create file named "1toto"
 
+## cotes parsing
+"echo 'test'" # simple cotes
+"echo \"test\"" # double cotes
+"echo '   simple    ' \"   double  \"" # Mix simple and double cotes
+"echo \"6789      \" \"    2345\"" # two coted blocks
+"echo \"6789      \"         \"    2345\"" # two coted blocks seperated with many spaces
+"echo \"6789      \"  test   \"    2345\"" # two coted blocks seperated with non coted block
+"echo nasruitersaui \"6789      \" ransuite  \"    2345\"   anruistenrasuit" # big one
+#"echo \"!\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\""
+# test all ASCII char: check they are used to split str like '|' or ';'
+"echo \"nrsatu;nrtsa\""
+
+### Back cotes: pipe
+"echo \`ls\`" # back cotes
+
+### cotes non-closed
+
 ## Mix
 "rm $tmpf ; ls ; pwd; ls -a | cat -e | wc > $tmpf ; cat $tmpf ; rm $tmpf" # point-virgules, pipes et redirection
 "ls -a | cat -e | wc >> $tmpf ; cat $tmpf ; rm $tmpf" # pipes et double redirection