├── .gitignore ├── 42ShellTester.sh ├── README.md ├── lib ├── assert.sh ├── assets │ ├── 42ShellTester.ascii │ ├── 42ShellTester.png │ ├── 42ShellTester_250x250.png │ ├── 42ShellTester_416x416.png │ ├── 42ShellTester_cropped.png │ ├── 42shTestsTeamLogo.png │ ├── 42shTestsTeamLogo_sm.png │ ├── README.md │ ├── hard.png │ ├── non-posix.png │ └── pending.png ├── main.sh └── verbs │ ├── be_empty.sh │ ├── create_file.sh │ ├── exit_with_status.sh │ ├── have_nb_of_lines.sh │ ├── match_each_regex_of_file.sh │ └── match_regex.sh ├── spec ├── 21sh │ ├── README.md │ ├── misc │ │ ├── 001-no-prompt-in-non-interactive-mode │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-simple-command-line │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ ├── pipe │ │ ├── 001-single-pipe │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-chained-pipes │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-many-chained-pipes │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 004-without-surrounding-whitespaces │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 005-asynchronous │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 006-exit-status │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ └── stdin │ │ ├── README.md │ │ └── mixed │ │ │ ├── 001-exit-or-not-exit │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── hard │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-cd-or-not-cd │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── hard │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-unsetenv-or-not-unsetenv │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── hard │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 004-setenv-or-not-setenv │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── hard │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── redirections │ │ ├── README.md │ │ ├── inputs │ │ │ ├── 001-close-stdin │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-filename │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-filename-with-whitespaces │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-absolute-path │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 005-no-such-file │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ └── outputs │ │ │ ├── README.md │ │ │ ├── appending │ │ │ ├── 001-append-default-to-file │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-append-stdout-to-file │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-append-stderr-to-file │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── README.md │ │ │ └── multiple │ │ │ │ ├── 001-append-twice-separately │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ ├── closing │ │ │ ├── 001-close-default-output │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-close-stdout │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-close-stderr │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-close-twice-outputs │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ ├── touching │ │ │ ├── 001-works │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ └── truncating │ │ │ ├── 001-creates-file-if-not-exits │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-truncates-file-if-exists │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-whitespace-before-filename │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── README.md │ │ │ ├── multiple │ │ │ ├── 001-separately │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-together-stdout-first │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-together-stderr-first │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-together │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 005-together-with-whitespaces │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ ├── stderr │ │ │ ├── 001-works │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ └── stdout │ │ │ ├── 001-with-explicit-fd │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ └── separators │ │ ├── README.md │ │ └── semicolon │ │ ├── 001-two-commands-sequentially │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 002-n-commands-sequentially │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 003-parse-error-empty-inline-command │ │ ├── README.md │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 004-parse-error-empty-command │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ └── README.md ├── 42sh │ ├── README.md │ ├── builtins │ │ ├── README.md │ │ └── export │ │ │ ├── 001-display-env │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-export-basic-key-value-1 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-export-basic-key-value-2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 004-export-empty-variable-1 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 005-export-empty-variable-2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 006-export-update-env-variable │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 007-existing-environment-variable │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 008-local-to-environment │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 009-export-with-equal-but-no-value-part1 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 010-export-with-equal-but-no-value-part2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── README.md │ │ │ ├── errors │ │ │ ├── 001-invalid-identifier-1 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-invalid-identifier-2 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-illegal-option │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ └── stdin │ │ │ └── README.md │ │ │ ├── mixed │ │ │ ├── 001-export-and-tmp-env-part1 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-export-and-tmp-env-part2 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ └── options │ │ │ ├── 001-export-with-only-p-parameter │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-export-p-param-and-token-should-add-local-var-only-part1 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-export-p-param-and-token-should-add-local-var-only-part2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 004-export-n-param │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── escaping │ │ ├── 001-escape-single-character-1 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-escape-single-character-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-escape-single-character-3 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 004-escape-single-character-4 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 005-escape-single-character-5 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── README.md │ │ └── mixed │ │ │ ├── README.md │ │ │ ├── globbing │ │ │ ├── README.md │ │ │ ├── brace-expansion │ │ │ │ ├── 001-it-does-not-expand-braces-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 002-it-expands-braces-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 003-it-expands-braces-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ └── bracket-expansion │ │ │ │ ├── 001-it-does-not-expand-brackets │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 002-escaped-inversion-mark │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 003-it-takes-escaped-bracket-as-pattern-character │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ └── variable-expansion │ │ │ ├── 001-escape-variable-1 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-it-does-not-escape-variable │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-escape-variable-2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── globbing │ │ ├── README.md │ │ ├── brace-expansion │ │ │ ├── README.md │ │ │ ├── ascii-range │ │ │ │ ├── 001-simple-ascending-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 002-simple-ascending-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 003-simple-ascending-3 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 004-simple-descending-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 005-simple-descending-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 006-simple-descending-3 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 007-identical-start-and-end │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 008-multiple-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 009-multiple-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 010-big-range │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ ├── errors │ │ │ │ ├── 001-invalid-pattern-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── misc │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 002-invalid-pattern-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── misc │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 003-invalid-pattern-3 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── misc │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 004-invalid-pattern-4 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── misc │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ ├── list-of-values │ │ │ │ ├── 001-nothing-to-be-done │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 002-simple-test-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 003-simple-test-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ └── numeric-range │ │ │ │ ├── 001-simple-ascending-1 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 002-simple-ascending-2 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 003-simple-ascending-3 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 004-simple-ascending-4 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 005-simple-ascending-5 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 006-simple-descending-1 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 007-simple-descending-2 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 008-simple-descending-3 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 009-simple-descending-4 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 010-simple-descending-5 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 011-identical-positive-start-and-end │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 012-identical-negative-start-and-end │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 013-multiple-1 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 014-multiple-2 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 015-big-range │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ └── bracket-expansion │ │ │ ├── README.md │ │ │ ├── multi │ │ │ ├── 001-range-and-char │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-reverse-range-and-chars │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-reverse-multi-hard │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-simple-bracket+char+range │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ ├── not │ │ │ ├── 001-simple-opposit-match │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-simple-opposite-range │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ ├── range-pattern │ │ │ ├── 001-alpha-range │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-numeric-range │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-ascii-range-1 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-ascii-range-2 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ ├── simple-pattern │ │ │ ├── 001-simple-list │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-multi-bracket │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-brackets-as-pattern │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-multi-bracket-multi-char │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ └── single-char-pattern │ │ │ ├── 001-single-char │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-closing-bracket-char │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-opening-bracket-char │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── local-variable │ │ ├── 001-declare-and-expand-1 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-declare-and-expand-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-unknown-variable-does-not-result-in-new-argument │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 004-existing-variable-in-environment-1 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 005-existing-variable-in-environment-2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 006-existing-variable-in-environment-3 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 007-multiple-declaration-at-a-time │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 008-multiple-declaration-with-same-name │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 009-last-exit-status │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── README.md │ │ └── mixed │ │ │ ├── README.md │ │ │ ├── inline-environment-variable │ │ │ ├── 001-local-variable-shouldnt-be-set │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ ├── redirections │ │ │ ├── 001-truncating │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-appending │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-reading │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ └── tilde-expansion │ │ │ ├── 001-process-tilde-expansion │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── quoting │ │ ├── README.md │ │ ├── double-quotes │ │ │ ├── 001-it-works │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-concatenated-strings │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-first-argument-inhibited │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-multiline-1 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 005-multiline-2 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── README.md │ │ │ └── mixed │ │ │ │ ├── README.md │ │ │ │ ├── escaping │ │ │ │ ├── 001-escape-double-quote-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 002-escape-double-quote-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 003-escape-double-quote-3 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 004-it-results-in-error │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 005-it-does-not-escape-double-quote │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ │ ├── globbing │ │ │ │ ├── README.md │ │ │ │ ├── brace-expansion │ │ │ │ │ ├── 001-it-does-not-expand-braces-1 │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── stdin │ │ │ │ │ │ └── stdout │ │ │ │ │ ├── 002-it-does-not-expand-braces-2 │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── stdin │ │ │ │ │ │ └── stdout │ │ │ │ │ ├── 003-it-does-not-expand-braces-3 │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── stdin │ │ │ │ │ │ └── stdout │ │ │ │ │ ├── 004-it-does-not-expand-braces-4 │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── stdin │ │ │ │ │ │ └── stdout │ │ │ │ │ ├── 005-it-does-not-expand-braces-5 │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── stdin │ │ │ │ │ │ └── stdout │ │ │ │ │ └── README.md │ │ │ │ └── bracket-expansion │ │ │ │ │ ├── 001-it-works-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── before_exec │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ │ ├── 002-it-works-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── before_exec │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ │ └── README.md │ │ │ │ └── variable-expansion │ │ │ │ ├── 001-expansion-enabled │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ ├── mixed │ │ │ ├── 001-simple-and-double-quotes │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-multiline │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── README.md │ │ │ ├── globbing │ │ │ │ ├── README.md │ │ │ │ ├── brace-expansion │ │ │ │ │ ├── 001-it-does-not-expand-braces-1 │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── stdin │ │ │ │ │ │ └── stdout │ │ │ │ │ └── README.md │ │ │ │ └── bracket-expansion │ │ │ │ │ ├── 001-it-works-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── before_exec │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ │ ├── 002-it-works-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── before_exec │ │ │ │ │ ├── description │ │ │ │ │ ├── stderr │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ │ └── README.md │ │ │ └── variable-expansion │ │ │ │ ├── 001-it-does-not-expand-in-quotes │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ └── simple-quotes │ │ │ ├── 001-it-works │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-concatenated-strings │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-first-argument-inhibited │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 004-multiline-1 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 005-multiline-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── README.md │ │ │ └── mixed │ │ │ ├── README.md │ │ │ ├── escaping │ │ │ ├── 001-escape-simple-quote-1 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-escape-simple-quote-2 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-escape-simple-quote-3 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-it-does-not-escape-simple-quote-1 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 005-it-does-not-escape-simple-quote-2 │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ │ ├── globbing │ │ │ ├── README.md │ │ │ ├── brace-expansion │ │ │ │ ├── 001-it-does-not-expand-braces-1 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 002-it-does-not-expand-braces-2 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 003-it-does-not-expand-braces-3 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 004-it-does-not-expand-braces-4 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ ├── 005-it-does-not-expand-braces-5 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── description │ │ │ │ │ ├── stdin │ │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ └── bracket-expansion │ │ │ │ ├── 001-it-works-1 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 002-it-works-2 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ │ └── variable-expansion │ │ │ ├── 001-expansion-disabled │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ └── subshell │ │ ├── 001-tokens-are-recognized │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 002-multiple-levels-of-subshells │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 003-multiline │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 004-exit-status │ │ ├── README.md │ │ ├── description │ │ ├── misc │ │ └── stdin │ │ ├── 005-copy-of-environment │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── README.md │ │ ├── errors │ │ ├── 001-parse-error-1 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-parse-error-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-parse-error-3 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 004-parse-error-4 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ │ └── mixed │ │ ├── README.md │ │ ├── builtins │ │ ├── README.md │ │ ├── cd │ │ │ ├── 001-it-does-not-change-current-directory │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-multiline │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ ├── exit │ │ │ ├── 001-exiting-subshell │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ ├── setenv │ │ │ ├── 001-it-does-not-modify-parent-environment │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ └── unsetenv │ │ │ ├── 001-it-does-not-modify-parent-environment │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ │ ├── escaping │ │ ├── 001-escaped-subshell-1 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-escaped-subshell-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ │ ├── inline-environment-variable │ │ ├── 001-modifies-the-child-environment-only-1 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-modifies-the-child-environment-only-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ │ ├── piping │ │ ├── 001-subshells-inside-piped-command │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-pipes-inside-subshells │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-imbricated-subshells-and-pipes │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ │ └── quoting │ │ ├── 001-with-simple-quotes │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 002-with-double-quotes │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ ├── 003-with-simple-and-double-quotes │ │ ├── README.md │ │ ├── description │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ │ └── README.md ├── README.md ├── bonuses │ ├── README.md │ ├── builtins │ │ ├── README.md │ │ └── env │ │ │ ├── 001-unset-variables │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── non-posix │ │ │ ├── pending │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-unset-and-set-variable │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── non-posix │ │ │ ├── pending │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── inline-environment-variable │ │ ├── 001-modifies-child-environment-1 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-modifies-child-environment-2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-modifies-PATH-only │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ ├── redirections │ │ ├── 001-append-twice-outputs-together │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── hard │ │ │ ├── misc │ │ │ ├── non-posix │ │ │ ├── pending │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ ├── separators │ │ ├── README.md │ │ ├── and │ │ │ ├── 001-run-twice │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-do-not-run-second │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-run-until-failing │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── README.md │ │ │ └── errors │ │ │ │ ├── 001-parse-error-at-beginning │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ ├── 002-parse-error-too-much-symbol │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ │ └── README.md │ │ ├── mixed │ │ │ ├── 001-and-or │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-and-or │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 003-and-or │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-or-and │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 005-or-and │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 006-or-and │ │ │ │ ├── README.md │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ └── README.md │ │ └── or │ │ │ ├── 001-run-first-only │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-run-second-only │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 003-run-until-succeeding │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── README.md │ │ │ └── errors │ │ │ ├── 001-parse-error-at-beginning │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-parse-error-too-much-symbol │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ └── tilde-expansion │ │ ├── 001-expanded-with-HOME-1 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 002-expanded-with-HOME-2 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 003-expanded-with-PWD-1 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 004-expanded-with-PWD-2 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 005-expanded-with-OLDPWD-1 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 006-expanded-with-OLDPWD-2 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── README.md │ │ └── not-expanded │ │ ├── 001-not-expanded-with-HOME-1 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 002-not-expanded-with-HOME-2 │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 003-not-expanded-with-PWD │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 004-not-expanded-with-OLDPWD │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ └── README.md └── minishell │ ├── README.md │ ├── binary │ ├── 001-binary-path-relative │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ ├── 002-binary-path-absolute │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ ├── 003-binary-test-exec-order │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ ├── 004-binary-test-empty-path │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ ├── 005-binary-test-wrong-path │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ ├── 006-binary-undefined-path │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ ├── 007-binary-permission-denied │ │ ├── README.md │ │ ├── after_exec │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ ├── 008-binary-too-many-symbolic-links-encountered │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── misc │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ └── README.md │ ├── builtins │ ├── README.md │ ├── cd │ │ ├── 001-no-arg │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-current-directory │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-current-directory-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 004-parent-directory │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 005-root-path │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 006-root-path-2 │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 007-symbolic-link │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 008-symbolic-link-2 │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 009-following-links │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── hard │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 010-update-OLDPWD │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 011-dotdot │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 012-dot │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 013-absolute-path │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── README.md │ │ ├── errors │ │ │ ├── 001-not-a-directory │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 002-not-a-directory-2 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ └── stdin │ │ │ ├── 003-permission-denied │ │ │ │ ├── README.md │ │ │ │ ├── after_exec │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 004-permission-denied-2 │ │ │ │ ├── README.md │ │ │ │ ├── after_exec │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ └── stdin │ │ │ ├── 005-too-many-symbolic-links-encountered │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 006-too-many-symbolic-links-encountered-2 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ └── stdin │ │ │ ├── 007-no-such-file-or-directory │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 008-no-such-file-or-directory-2 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ └── stdin │ │ │ ├── 009-no-such-file-or-directory-symlink │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── stderr │ │ │ │ ├── stdin │ │ │ │ └── stdout │ │ │ ├── 010-no-such-file-or-directory-symlink-2 │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ └── stdin │ │ │ └── README.md │ │ └── options │ │ │ ├── 001-not-following-links │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-oldpwd │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── env │ │ ├── 001-env-same-value-as-parent │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-env-check-usefull-var │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-ignore-environment │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 005-set-variables │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── README.md │ │ ├── errors │ │ │ ├── 001-command-not-found │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ └── stdin │ │ │ ├── 002-illegal-option │ │ │ │ ├── README.md │ │ │ │ ├── before_exec │ │ │ │ ├── description │ │ │ │ ├── misc │ │ │ │ ├── stderr │ │ │ │ └── stdin │ │ │ └── README.md │ │ └── multiple-options │ │ │ ├── 001-ignore-environment-and-set-variable │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── exit │ │ ├── 001-without-any-argument │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-status-passed-as-argument │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-status-of-last-command │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── README.md │ │ └── errors │ │ │ ├── 001-too-many-args │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ ├── 002-non-numeric-argument │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── misc │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ │ └── README.md │ ├── mixed │ │ ├── 001-setenv-unsetenv │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ ├── setenv │ │ ├── 001-no-argument │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 002-add-new-variable │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 003-set-existing-variable │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 004-invalid-identifier │ │ │ ├── README.md │ │ │ ├── description │ │ │ ├── stderr │ │ │ ├── stdin │ │ │ └── stdout │ │ ├── 005-add-and-set-multiple-variables │ │ │ ├── README.md │ │ │ ├── before_exec │ │ │ ├── description │ │ │ ├── stdin │ │ │ └── stdout │ │ └── README.md │ └── unsetenv │ │ ├── 001-unsetenv-first-elem │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 002-unsetenv-mult-envp │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ ├── 003-unsetenv-mult-envp-inline │ │ ├── README.md │ │ ├── before_exec │ │ ├── description │ │ ├── stdin │ │ └── stdout │ │ └── README.md │ └── misc │ ├── 001-copy-of-environment │ ├── README.md │ ├── before_exec │ ├── description │ ├── stdin │ └── stdout │ └── README.md ├── support ├── Makefile ├── display-env │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── display-program-name │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── display-pwd │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── exit-with-status │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── read-on-stdin │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── sleep-and-exit-with-status │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── sleep-and-write-on-stderr │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── write-all-arguments-on-stdout │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── write-on-stderr │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c ├── write-on-stdout-and-stderr │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c └── write-on-stdout │ ├── Makefile │ ├── README.md │ ├── description │ └── main.c └── tasks └── generate_readmes.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | tmp/ 3 | .mshell_hist 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /lib/assets/42ShellTester.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/42ShellTester.png -------------------------------------------------------------------------------- /lib/assets/42ShellTester_250x250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/42ShellTester_250x250.png -------------------------------------------------------------------------------- /lib/assets/42ShellTester_416x416.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/42ShellTester_416x416.png -------------------------------------------------------------------------------- /lib/assets/42ShellTester_cropped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/42ShellTester_cropped.png -------------------------------------------------------------------------------- /lib/assets/42shTestsTeamLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/42shTestsTeamLogo.png -------------------------------------------------------------------------------- /lib/assets/42shTestsTeamLogo_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/42shTestsTeamLogo_sm.png -------------------------------------------------------------------------------- /lib/assets/hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/hard.png -------------------------------------------------------------------------------- /lib/assets/non-posix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/non-posix.png -------------------------------------------------------------------------------- /lib/assets/pending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/lib/assets/pending.png -------------------------------------------------------------------------------- /spec/21sh/README.md: -------------------------------------------------------------------------------- 1 | # 21sh 2 | 3 | *[spec](..) > 21sh* 4 | 5 | * [misc](./misc) 6 | * [pipe](./pipe) 7 | * [redirections](./redirections) 8 | * [separators](./separators) 9 | -------------------------------------------------------------------------------- /spec/21sh/misc/001-no-prompt-in-non-interactive-mode/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/misc/001-no-prompt-in-non-interactive-mode/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/21sh/misc/001-no-prompt-in-non-interactive-mode/stdout: -------------------------------------------------------------------------------- 1 | expected_to have_nb_of_lines 1 2 | expected_to match_regex "^${GLOBAL_TOKEN}$" 3 | -------------------------------------------------------------------------------- /spec/21sh/misc/002-simple-command-line/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/misc/002-simple-command-line/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_FILE$" 2 | expected_to match_each_regex_of_file "./size" 3 | -------------------------------------------------------------------------------- /spec/21sh/pipe/001-single-pipe/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stderr$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/001-single-pipe/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr | ./read_on_stdin 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/001-single-pipe/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stdout@$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/002-chained-pipes/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stderr$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/002-chained-pipes/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr | ./read_on_stdin | ./read_on_stdin 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/002-chained-pipes/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stdout@@$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/003-many-chained-pipes/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stderr$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/003-many-chained-pipes/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stdout@@@@@@@@@@$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/004-without-surrounding-whitespaces/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/004-without-surrounding-whitespaces/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}|./read_on_stdin 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/004-without-surrounding-whitespaces/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}@$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/005-asynchronous/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/005-asynchronous/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_SECOND${GLOBAL_TOKEN}_FIRST${GLOBAL_TOKEN}_LAST" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/005-asynchronous/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/006-exit-status/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the exit status of a pipeline command is the same as the last piped process. 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/006-exit-status/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "42" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/006-exit-status/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/006-exit-status/stdin: -------------------------------------------------------------------------------- 1 | ./sleep_and_exit_with_status 1 21 | ./exit_with_status 42 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/001-exit-or-not-exit/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/001-exit-or-not-exit/stdin: -------------------------------------------------------------------------------- 1 | exit | ./write_on_stdout ${GLOBAL_TOKEN}_1 2 | ./write_on_stdout ${GLOBAL_TOKEN}_2 3 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/001-exit-or-not-exit/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_1" 2 | expected_to match_regex "${GLOBAL_TOKEN}_2" 3 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/002-cd-or-not-cd/description: -------------------------------------------------------------------------------- 1 | Calling the built-in `cd` in a piped process does not result in a current directory change. 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/002-cd-or-not-cd/hard: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/we-sh/42ShellTester/e8f74d8506b902435c24d44f9da5e4b03ea81131/spec/21sh/pipe/mixed/002-cd-or-not-cd/hard -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/002-cd-or-not-cd/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/002-cd-or-not-cd/stdin: -------------------------------------------------------------------------------- 1 | cd / | ./display_pwd 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/002-cd-or-not-cd/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/003-unsetenv-or-not-unsetenv/before_exec: -------------------------------------------------------------------------------- 1 | export VARIABLE_TEST="${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/003-unsetenv-or-not-unsetenv/description: -------------------------------------------------------------------------------- 1 | Calling the built-in `unsetenv` (or `unset`) in a piped process does not result in an environment change. 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/003-unsetenv-or-not-unsetenv/stdin: -------------------------------------------------------------------------------- 1 | unsetenv VARIABLE_TEST | unset VARIABLE_TEST | ./display_env 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/003-unsetenv-or-not-unsetenv/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "VARIABLE_TEST=${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/004-setenv-or-not-setenv/before_exec: -------------------------------------------------------------------------------- 1 | unset VARIABLE_TEST 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/004-setenv-or-not-setenv/description: -------------------------------------------------------------------------------- 1 | Calling the built-in `setenv` (or `export`) in a piped process does not result in an environment change. 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/004-setenv-or-not-setenv/stdin: -------------------------------------------------------------------------------- 1 | setenv VARIABLE_TEST | export VARIABLE_TEST | ./display_env 2 | -------------------------------------------------------------------------------- /spec/21sh/pipe/mixed/004-setenv-or-not-setenv/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "VARIABLE_TEST=" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/README.md: -------------------------------------------------------------------------------- 1 | # redirections 2 | 3 | *[spec > 21sh](..) > redirections* 4 | 5 | * [inputs](./inputs) 6 | * [outputs](./outputs) 7 | -------------------------------------------------------------------------------- /spec/21sh/redirections/inputs/001-close-stdin/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "1" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/inputs/001-close-stdin/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "STDIN READ ERROR$" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/inputs/001-close-stdin/stdin: -------------------------------------------------------------------------------- 1 | ./read_on_stdin <&- 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/inputs/001-close-stdin/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/inputs/002-filename/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/inputs/002-filename/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/inputs/002-filename/stdin: -------------------------------------------------------------------------------- 1 | ./read_on_stdin append_file_default 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/001-append-default-to-file/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/001-append-default-to-file/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_default ${GLOBAL_TOKEN}_stderr >>append_file_default 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/001-append-default-to-file/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_default" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/002-append-stdout-to-file/before_exec: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "${GLOBAL_TOKEN}_first" >append_file_stdout 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/002-append-stdout-to-file/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/002-append-stdout-to-file/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr 1>>append_file_stdout 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/002-append-stdout-to-file/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/003-append-stderr-to-file/before_exec: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "${GLOBAL_TOKEN}_first" >append_file_stderr 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/003-append-stderr-to-file/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/003-append-stderr-to-file/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr 2>>append_file_stderr 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/003-append-stderr-to-file/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stdout" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/multiple/001-append-twice-separately/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stderr_second" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/appending/multiple/001-append-twice-separately/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stdout_second" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/001-close-default-output/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/001-close-default-output/misc: -------------------------------------------------------------------------------- 1 | expected_to_not create_file "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/001-close-default-output/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/001-close-default-output/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr >&- 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/001-close-default-output/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/002-close-stdout/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/002-close-stdout/description: -------------------------------------------------------------------------------- 1 | Closing the standard output has the same behavior as redirecting to `/dev/null` (e.g. `ls 1>/dev/null`). 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/002-close-stdout/misc: -------------------------------------------------------------------------------- 1 | expected_to_not create_file "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/002-close-stdout/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/002-close-stdout/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr 1>&- 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/002-close-stdout/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/003-close-stderr/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/003-close-stderr/description: -------------------------------------------------------------------------------- 1 | Closing the standard error has the same behavior as redirecting to `/dev/null` (e.g. `ls 2>/dev/null`). 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/003-close-stderr/misc: -------------------------------------------------------------------------------- 1 | expected_to_not create_file "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/003-close-stderr/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/003-close-stderr/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr 2>&- 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/003-close-stderr/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_stdout" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/004-close-twice-outputs/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/004-close-twice-outputs/misc: -------------------------------------------------------------------------------- 1 | expected_to_not create_file "-" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/004-close-twice-outputs/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/004-close-twice-outputs/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_stdout ${GLOBAL_TOKEN}_stderr 1>&- 2>&- 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/closing/004-close-twice-outputs/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/touching/001-works/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "./new_empty_file" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/touching/001-works/misc: -------------------------------------------------------------------------------- 1 | expected_to create_file "new_empty_file" 2 | expected_to exit_with_status "0" 3 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/touching/001-works/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/touching/001-works/stdin: -------------------------------------------------------------------------------- 1 | >new_empty_file 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/touching/001-works/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/touching/README.md: -------------------------------------------------------------------------------- 1 | # touching 2 | 3 | *[spec > 21sh > redirections > outputs](..) > touching* 4 | 5 | * [001-works](./001-works) 6 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/before_exec: -------------------------------------------------------------------------------- 1 | rm -f new_file 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN} >new_file 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/001-creates-file-if-not-exits/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/before_exec: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}_first >truncated_file 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}_second >truncated_file 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/002-truncates-file-if-exists/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex ${GLOBAL_TOKEN}_second 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "new_file" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN} > new_file 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/003-whitespace-before-filename/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/001-separately/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "new_file_stderr" 2 | rm -f "new_file_stdout" 3 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/001-separately/description: -------------------------------------------------------------------------------- 1 | A different right redirection may be specified for each output. 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/001-separately/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_1" 2 | expected_to_not match_regex "${GLOBAL_TOKEN}_2" 3 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/001-separately/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_1 ${GLOBAL_TOKEN}_2 1>new_file_stdout 2>new_file_stderr 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/001-separately/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_1" 2 | expected_to_not match_regex "${GLOBAL_TOKEN}_2" 3 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/002-together-stdout-first/before_exec: -------------------------------------------------------------------------------- 1 | rm -f new_file_stderr_and_stdout 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/003-together-stderr-first/before_exec: -------------------------------------------------------------------------------- 1 | rm -f new_file_stderr_and_stdout 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/004-together/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "new_file_stderr_and_stdout" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/004-together/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_1 ${GLOBAL_TOKEN}_2 &>new_file_stderr_and_stdout 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces/before_exec: -------------------------------------------------------------------------------- 1 | rm -f new_file_stderr_and_stdout 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/stderr/001-works/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "./new_file_stderr" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/stderr/001-works/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_STDERR" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/stderr/001-works/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr ${GLOBAL_TOKEN}_STDOUT ${GLOBAL_TOKEN}_STDERR 2>new_file_stderr 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/stderr/001-works/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_STDOUT" 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd/before_exec: -------------------------------------------------------------------------------- 1 | rm -f new_file -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd/stdin: -------------------------------------------------------------------------------- 1 | /bin/echo TOKEN1 1>new_file 2 | -------------------------------------------------------------------------------- /spec/21sh/redirections/outputs/truncating/stdout/001-with-explicit-fd/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex TOKEN1 2 | -------------------------------------------------------------------------------- /spec/21sh/separators/README.md: -------------------------------------------------------------------------------- 1 | # separators 2 | 3 | *[spec > 21sh](..) > separators* 4 | 5 | * [semicolon](./semicolon) 6 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/001-two-commands-sequentially/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/001-two-commands-sequentially/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}_FIRST ; ./write_on_stdout ${GLOBAL_TOKEN}_SECOND 2 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/002-n-commands-sequentially/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/003-parse-error-empty-inline-command/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "42" 2 | expected_to_not exit_with_status "0" 3 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/003-parse-error-empty-inline-command/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/003-parse-error-empty-inline-command/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN} ; ; ./exit_with_status 42 2 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/003-parse-error-empty-inline-command/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/004-parse-error-empty-command/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Pp]arse|[Ss]yntax) error" 3 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/004-parse-error-empty-command/stdin: -------------------------------------------------------------------------------- 1 | ; 2 | -------------------------------------------------------------------------------- /spec/21sh/separators/semicolon/004-parse-error-empty-command/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/README.md: -------------------------------------------------------------------------------- 1 | # builtins 2 | 3 | *[spec > 42sh](..) > builtins* 4 | 5 | * [export](./export) 6 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/001-display-env/before_exec: -------------------------------------------------------------------------------- 1 | rm -rf "./stored_env" 2 | env | awk 'BEGIN {FS="="} $0 !~ /^(OLDPWD|_)/ {print $1"="}' > "./stored_env" 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/001-display-env/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/001-display-env/stdin: -------------------------------------------------------------------------------- 1 | export 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/001-display-env/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_each_regex_of_file "./stored_env" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/002-export-basic-key-value-1/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/002-export-basic-key-value-1/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the builtin `export` may declare a new environment variable. 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/002-export-basic-key-value-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/002-export-basic-key-value-1/stdin: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/002-export-basic-key-value-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE$" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/003-export-basic-key-value-2/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/003-export-basic-key-value-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/003-export-basic-key-value-2/stdin: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE 2 | export 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/003-export-basic-key-value-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_NAME=[\"]?${GLOBAL_TOKEN}_VALUE[\"]?$" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/004-export-empty-variable-1/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/004-export-empty-variable-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/004-export-empty-variable-1/stdin: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN} 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/004-export-empty-variable-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/005-export-empty-variable-2/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/005-export-empty-variable-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/005-export-empty-variable-2/stdin: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN} 2 | export 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/005-export-empty-variable-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/006-export-update-env-variable/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/006-export-update-env-variable/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/007-existing-environment-variable/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE1" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/007-existing-environment-variable/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/007-existing-environment-variable/stdin: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE2 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/008-local-to-environment/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/008-local-to-environment/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE 2 | export ${GLOBAL_TOKEN}_NAME 3 | ./display_env 4 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/008-local-to-environment/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE$" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/009-export-with-equal-but-no-value-part1/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}" -------------------------------------------------------------------------------- /spec/42sh/builtins/export/009-export-with-equal-but-no-value-part1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/009-export-with-equal-but-no-value-part1/stdin: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN}_NAME= 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/009-export-with-equal-but-no-value-part1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_NAME=" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/010-export-with-equal-but-no-value-part2/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}" -------------------------------------------------------------------------------- /spec/42sh/builtins/export/010-export-with-equal-but-no-value-part2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/010-export-with-equal-but-no-value-part2/stdin: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN}_NAME= 2 | export 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/010-export-with-equal-but-no-value-part2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_NAME=" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/001-invalid-identifier-1/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/001-invalid-identifier-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "(not.*identifier|must begin.*letter)" 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/001-invalid-identifier-1/stdin: -------------------------------------------------------------------------------- 1 | export 42=${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/001-invalid-identifier-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/002-invalid-identifier-2/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/002-invalid-identifier-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "(not.*identifier|must begin.*letter)" 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/002-invalid-identifier-2/stdin: -------------------------------------------------------------------------------- 1 | export .=${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/002-invalid-identifier-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/003-illegal-option/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/003-illegal-option/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ii]nvalid|[Ii]llegal) (option|argument)" 3 | 4 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/errors/003-illegal-option/stdin: -------------------------------------------------------------------------------- 1 | export -w 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/001-export-and-tmp-env-part1/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/001-export-and-tmp-env-part1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/001-export-and-tmp-env-part1/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE export ${GLOBAL_TOKEN}_NAME 2 | export 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/001-export-and-tmp-env-part1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_NAME=[\"]?${GLOBAL_TOKEN}_VALUE[\"]?" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/002-export-and-tmp-env-part2/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/002-export-and-tmp-env-part2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/002-export-and-tmp-env-part2/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE export ${GLOBAL_TOKEN}_NAME 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/mixed/002-export-and-tmp-env-part2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/001-export-with-only-p-parameter/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/001-export-with-only-p-parameter/stdin: -------------------------------------------------------------------------------- 1 | export -p 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/001-export-with-only-p-parameter/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_each_regex_of_file "./stored_env" 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/002-export-p-param-and-token-should-add-local-var-only-part1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/002-export-p-param-and-token-should-add-local-var-only-part1/stdin: -------------------------------------------------------------------------------- 1 | export -p ${GLOBAL_TOKEN}_NAME 2 | export 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/003-export-p-param-and-token-should-add-local-var-only-part2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/003-export-p-param-and-token-should-add-local-var-only-part2/stdin: -------------------------------------------------------------------------------- 1 | export -p ${GLOBAL_TOKEN}_NAME 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/004-export-n-param/before_exec: -------------------------------------------------------------------------------- 1 | export ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE 2 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/004-export-n-param/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/004-export-n-param/stdin: -------------------------------------------------------------------------------- 1 | export -n ${GLOBAL_TOKEN}_NAME 2 | export 3 | ./display_env 4 | -------------------------------------------------------------------------------- /spec/42sh/builtins/export/options/004-export-n-param/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/001-escape-single-character-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/001-escape-single-character-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}\${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/001-escape-single-character-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/002-escape-single-character-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/002-escape-single-character-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}\\${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/002-escape-single-character-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}\\${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/003-escape-single-character-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/003-escape-single-character-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}\\\${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/003-escape-single-character-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}\\${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/004-escape-single-character-4/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/004-escape-single-character-4/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}\\\\${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/004-escape-single-character-4/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}\\\\${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/005-escape-single-character-5/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/005-escape-single-character-5/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout TEST4\041TEST 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/005-escape-single-character-5/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^TEST4041TEST$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout \{1..2} {1\..2} {1.\.2} {1..2\} 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^[{]1..2}@[{]1..2}@[{]1..2}@[{]1..2}@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/002-it-expands-braces-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/002-it-expands-braces-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout \\{1..2} 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/002-it-expands-braces-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^\\1@\\2@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/003-it-expands-braces-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/003-it-expands-braces-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout \\\{1..2} \\\\{1..2} \\\\\{1..2} \\\\\\{1..2} 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/brace-expansion/003-it-expands-braces-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^\\[{]1..2}@\\\\1@\\\\2@\\\\[{]1..2}@\\\\\\1@\\\\\\2@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/bracket-expansion/001-it-does-not-expand-brackets/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/bracket-expansion/001-it-does-not-expand-brackets/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout \[abc] [abc\] \[abc\] 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/bracket-expansion/001-it-does-not-expand-brackets/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^[[]abc]@[[]abc]@[[]abc]@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/bracket-expansion/002-escaped-inversion-mark/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/globbing/bracket-expansion/003-it-takes-escaped-bracket-as-pattern-character/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/001-escape-variable-1/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/001-escape-variable-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/001-escape-variable-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout \$${GLOBAL_TOKEN}_NAME 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/002-it-does-not-escape-variable/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/002-it-does-not-escape-variable/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/002-it-does-not-escape-variable/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout \\$${GLOBAL_TOKEN}_NAME 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/003-escape-variable-2/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/003-escape-variable-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/escaping/mixed/variable-expansion/003-escape-variable-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout \\\$${GLOBAL_TOKEN}_NAME 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/001-simple-ascending-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/001-simple-ascending-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {a..e} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/001-simple-ascending-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^a@b@c@d@e@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/002-simple-ascending-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/002-simple-ascending-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{a..e}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/003-simple-ascending-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/003-simple-ascending-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {A..E} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/003-simple-ascending-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^A@B@C@D@E@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/004-simple-descending-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/004-simple-descending-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {E..A} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/004-simple-descending-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^E@D@C@B@A@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/005-simple-descending-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/005-simple-descending-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{E..A}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/006-simple-descending-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/006-simple-descending-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{e..a} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/007-identical-start-and-end/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/007-identical-start-and-end/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {f..f} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/007-identical-start-and-end/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^f@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/008-multiple-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/008-multiple-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {a..b}{c..d}{e..f} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/008-multiple-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^ace@acf@ade@adf@bce@bcf@bde@bdf@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/009-multiple-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/009-multiple-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{a..b}abc{Z..X}def{s..s} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/010-big-range/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/ascii-range/010-big-range/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {A..z} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/001-invalid-pattern-1/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/001-invalid-pattern-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/001-invalid-pattern-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout {A} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/001-invalid-pattern-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^{A}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/002-invalid-pattern-2/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/002-invalid-pattern-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/002-invalid-pattern-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout {B..} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/002-invalid-pattern-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^{B..}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/003-invalid-pattern-3/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/003-invalid-pattern-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/003-invalid-pattern-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout {..C} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/003-invalid-pattern-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^{..C}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/004-invalid-pattern-4/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/004-invalid-pattern-4/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/004-invalid-pattern-4/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout {Q..C..1} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/errors/004-invalid-pattern-4/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^{Q..C..1}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/001-nothing-to-be-done/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/001-nothing-to-be-done/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout {${GLOBAL_TOKEN}} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/001-nothing-to-be-done/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "{${GLOBAL_TOKEN}}" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/002-simple-test-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/002-simple-test-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {${GLOBAL_TOKEN}_A,${GLOBAL_TOKEN}_B} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/002-simple-test-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_A@${GLOBAL_TOKEN}_B@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/003-simple-test-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/003-simple-test-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {${GLOBAL_TOKEN}_A,${GLOBAL_TOKEN}_B,${GLOBAL_TOKEN}_C} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/list-of-values/003-simple-test-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_A@${GLOBAL_TOKEN}_B@${GLOBAL_TOKEN}_C@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/001-simple-ascending-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/001-simple-ascending-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {1..5} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/001-simple-ascending-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^1@2@3@4@5@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/002-simple-ascending-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/002-simple-ascending-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{1..5}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/003-simple-ascending-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/003-simple-ascending-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{1..+5} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/004-simple-ascending-4/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/004-simple-ascending-4/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {-5..0}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/005-simple-ascending-5/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/005-simple-ascending-5/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {-100..-98}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/005-simple-ascending-5/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^-100${GLOBAL_TOKEN}@-99${GLOBAL_TOKEN}@-98${GLOBAL_TOKEN}@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/006-simple-descending-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/006-simple-descending-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {5..1} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/006-simple-descending-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^5@4@3@2@1@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/007-simple-descending-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/007-simple-descending-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{5..1}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/008-simple-descending-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/008-simple-descending-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{5..+1} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/009-simple-descending-4/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/009-simple-descending-4/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {0..-5}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/010-simple-descending-5/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/010-simple-descending-5/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {-98..-100}${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/010-simple-descending-5/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^-98${GLOBAL_TOKEN}@-99${GLOBAL_TOKEN}@-100${GLOBAL_TOKEN}@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/011-identical-positive-start-and-end/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/011-identical-positive-start-and-end/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {42..42} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/011-identical-positive-start-and-end/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^42@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/012-identical-negative-start-and-end/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/012-identical-negative-start-and-end/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {-42..-42} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/012-identical-negative-start-and-end/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^-42@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/013-multiple-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/013-multiple-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {1..2}{3..4}{5..6} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/013-multiple-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^135@136@145@146@235@236@245@246@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/014-multiple-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/014-multiple-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout ${GLOBAL_TOKEN}{1..2}abc{-50..-53}def{0..0} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/015-big-range/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/brace-expansion/numeric-range/015-big-range/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {-100..100} 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/multi/001-range-and-char/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/multi/001-range-and-char/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [a-z-2] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/multi/002-reverse-range-and-chars/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that brackets expansion works with 2 patterns. 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/multi/002-reverse-range-and-chars/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/multi/003-reverse-multi-hard/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/multi/004-simple-bracket+char+range/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/multi/004-simple-bracket+char+range/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [aZ]-[1-9] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/not/001-simple-opposit-match/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/not/002-simple-opposite-range/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/001-alpha-range/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/001-alpha-range/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [a-z] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/002-numeric-range/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/002-numeric-range/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [0-9] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/003-ascii-range-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/003-ascii-range-1/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout []-z] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/004-ascii-range-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/range-pattern/004-ascii-range-2/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [1-z] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/001-simple-list/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/001-simple-list/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [bca] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/002-multi-bracket/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/002-multi-bracket/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout ${GLOBAL_TOKEN}[a]b[c][d] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/003-brackets-as-pattern/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/003-brackets-as-pattern/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [][] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/004-multi-bracket-multi-char/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/simple-pattern/004-multi-bracket-multi-char/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [12][34] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/single-char-pattern/001-single-char/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/single-char-pattern/001-single-char/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [a] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/single-char-pattern/002-closing-bracket-char/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/single-char-pattern/002-closing-bracket-char/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout []] 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/single-char-pattern/003-opening-bracket-char/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/globbing/bracket-expansion/single-char-pattern/003-opening-bracket-char/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [[] 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/001-declare-and-expand-1/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that declaring and expanding a local variable does work. 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/001-declare-and-expand-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_VALUE$" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/001-declare-and-expand-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_VALUE$" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/002-declare-and-expand-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "write on stderr" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/002-declare-and-expand-2/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_NAME= 2 | ./write_on_stdout_and_stderr $${GLOBAL_TOKEN}_NAME $${GLOBAL_TOKEN}_NAME 3 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/002-declare-and-expand-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "write on stdout" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/003-unknown-variable-does-not-result-in-new-argument/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_UNKNOWN" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/003-unknown-variable-does-not-result-in-new-argument/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/003-unknown-variable-does-not-result-in-new-argument/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout $${GLOBAL_TOKEN}_UNKNOWN ${GLOBAL_TOKEN}_DISPLAYED 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/003-unknown-variable-does-not-result-in-new-argument/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_DISPLAYED" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/004-existing-variable-in-environment-1/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE_OLD" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/004-existing-variable-in-environment-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/local-variable/004-existing-variable-in-environment-1/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE_NEW 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/005-existing-variable-in-environment-2/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/005-existing-variable-in-environment-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/local-variable/005-existing-variable-in-environment-2/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_NAME= 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/006-existing-variable-in-environment-3/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/006-existing-variable-in-environment-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/local-variable/006-existing-variable-in-environment-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout $${GLOBAL_TOKEN}_NAME 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/006-existing-variable-in-environment-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_VALUE$" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/008-multiple-declaration-with-same-name/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/009-last-exit-status/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the special variable `$?` may be expanded with the last exit status. 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/009-last-exit-status/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^42$" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/009-last-exit-status/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 42 2 | ./write_on_stderr $? 3 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/009-last-exit-status/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/001-truncating/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "${GLOBAL_TOKEN}_FILENAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/001-truncating/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/001-truncating/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/002-appending/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "${GLOBAL_TOKEN}_FILENAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/002-appending/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/002-appending/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/003-reading/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "${GLOBAL_TOKEN}_FILENAME" 2 | echo "${GLOBAL_TOKEN}_VALUE" > "${GLOBAL_TOKEN}_FILENAME" 3 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/003-reading/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/003-reading/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_FILENAME 2 | ./read_on_stdin < $${GLOBAL_TOKEN}_NAME 3 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/redirections/003-reading/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_VALUE@$" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/tilde-expansion/001-process-tilde-expansion/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/tilde-expansion/001-process-tilde-expansion/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/tilde-expansion/001-process-tilde-expansion/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}=~ 2 | ./write_on_stdout TILDE:$${GLOBAL_TOKEN} 3 | -------------------------------------------------------------------------------- /spec/42sh/local-variable/mixed/tilde-expansion/001-process-tilde-expansion/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "TILDE:~" 2 | might match_regex "TILDE:/${GLOBAL_TOKEN}" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/001-it-works/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that using the symbol double quote `"` does not result in error. 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/001-it-works/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/001-it-works/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "SIMPLE TEXT WITH SPACES" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/001-it-works/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "SIMPLE TEXT WITH SPACES" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/002-concatenated-strings/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PQRSTUVWXYZ" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/002-concatenated-strings/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr A"B"CDEF"GHIJ""KLMNO" "P"QRS"T""U""V"WXYZ 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/002-concatenated-strings/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "ABCDEFGHIJKLMNO" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/003-first-argument-inhibited/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_STDERR" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/003-first-argument-inhibited/stdin: -------------------------------------------------------------------------------- 1 | "./write_on_stdout_and_stderr" ${GLOBAL_TOKEN}_STDOUT ${GLOBAL_TOKEN}_STDERR 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/003-first-argument-inhibited/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_STDOUT" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/004-multiline-1/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that closing double quote may be done on a different line. 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/004-multiline-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/004-multiline-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout " 2 | ${GLOBAL_TOKEN}_FIRST 3 | ${GLOBAL_TOKEN}_SECOND 4 | ${GLOBAL_TOKEN}_THIRD 5 | " 6 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/005-multiline-2/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that closing double quote may be done on a different line. 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/005-multiline-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_THIRD$" 2 | expected_to match_regex "^${GLOBAL_TOKEN}_FOURTH$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/005-multiline-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_FIRST$" 2 | expected_to match_regex "^${GLOBAL_TOKEN}_SECOND$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/001-escape-double-quote-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/001-escape-double-quote-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}\"${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/001-escape-double-quote-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}\"${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/002-escape-double-quote-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/002-escape-double-quote-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "${GLOBAL_TOKEN} \" ${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/002-escape-double-quote-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN} \" ${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/003-escape-double-quote-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/003-escape-double-quote-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "\"" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/003-escape-double-quote-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^\"$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/004-it-results-in-error/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/004-it-results-in-error/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "${GLOBAL_TOKEN}\" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/004-it-results-in-error/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "^${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/005-it-does-not-escape-double-quote/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/005-it-does-not-escape-double-quote/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout \\"${GLOBAL_TOKEN}\\" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/escaping/005-it-does-not-escape-double-quote/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^\\${GLOBAL_TOKEN}\\$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "{1..2}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "[{]1..2}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {1..2}"{1..2}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "1[{]1..2}@2[{]1..2}@" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout "{1..2}"{1..2} 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "[{]1..2}1@[{]1..2}2@" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout "{1..2}" {1..2} "{1..2}" "{1..2}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "[{]1..2}@1@2@[{]1..2}@[{]1..2}@" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/001-it-works-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/001-it-works-1/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout ["a"] 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/001-it-works-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "[[]a]@" 2 | expected_to match_regex "^a@$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/002-it-works-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/002-it-works-2/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout ["a"bc"def"gh] 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/variable-expansion/001-expansion-enabled/before_exec: -------------------------------------------------------------------------------- 1 | export "TOKEN=${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/variable-expansion/001-expansion-enabled/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/variable-expansion/001-expansion-enabled/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "$TOKEN" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/double-quotes/mixed/variable-expansion/001-expansion-enabled/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/001-simple-and-double-quotes/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "QRS'T'U''VWX\"YZ" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/001-simple-and-double-quotes/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr "ABCD'EFG"HI'J"KL"'MNO'P"' Q"RS'T'U''"VW'X"Y'Z 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/001-simple-and-double-quotes/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "ABCD'EFGHIJ\"KL\"MNOP" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/002-multiline/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_TH\"IRD$" 2 | expected_to match_regex "^${GLOBAL_TOKEN}_FOURTH$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/002-multiline/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_FIR'ST$" 2 | expected_to match_regex "^${GLOBAL_TOKEN}_SECOND$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout "{1..2}"{1..2}'{1..2}'{1..2}"{1..2}"{1..2} 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/globbing/bracket-expansion/001-it-works-1/before_exec: -------------------------------------------------------------------------------- 1 | rm -rf "./test_globbing" 2 | mkdir "./test_globbing" 3 | cd "./test_globbing" 4 | touch 'a' 5 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/globbing/bracket-expansion/001-it-works-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/globbing/bracket-expansion/001-it-works-1/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [""'a'""] 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/globbing/bracket-expansion/001-it-works-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "[[]a]@" 2 | expected_to match_regex "^a@$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/globbing/bracket-expansion/002-it-works-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/globbing/bracket-expansion/002-it-works-2/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout ["a"bc'def'gh] 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/variable-expansion/001-it-does-not-expand-in-quotes/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/variable-expansion/001-it-does-not-expand-in-quotes/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/quoting/mixed/variable-expansion/001-it-does-not-expand-in-quotes/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout "$${GLOBAL_TOKEN}_NAME"$${GLOBAL_TOKEN}_NAME'$${GLOBAL_TOKEN}_NAME' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/001-it-works/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that using the symbol simple quote `'` does not result in error. 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/001-it-works/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/001-it-works/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout 'SIMPLE TEXT WITH SPACES' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/001-it-works/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "SIMPLE TEXT WITH SPACES" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/002-concatenated-strings/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PQRSTUVWXYZ" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/002-concatenated-strings/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr A'B'CDEF'GHIJ''KLMNO' 'P'QRS'T''U''V'WXYZ 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/002-concatenated-strings/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "ABCDEFGHIJKLMNO" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/003-first-argument-inhibited/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_STDERR" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/003-first-argument-inhibited/stdin: -------------------------------------------------------------------------------- 1 | './write_on_stdout_and_stderr' ${GLOBAL_TOKEN}_STDOUT ${GLOBAL_TOKEN}_STDERR 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/003-first-argument-inhibited/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_STDOUT" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/004-multiline-1/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that closing double quote may be done on a different line. 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/004-multiline-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/004-multiline-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ' 2 | ${GLOBAL_TOKEN}_FIRST 3 | ${GLOBAL_TOKEN}_SECOND 4 | ${GLOBAL_TOKEN}_THIRD 5 | ' 6 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/005-multiline-2/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that closing double quote may be done on a different line. 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/005-multiline-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_THIRD$" 2 | expected_to match_regex "^${GLOBAL_TOKEN}_FOURTH$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/005-multiline-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_FIRST$" 2 | expected_to match_regex "^${GLOBAL_TOKEN}_SECOND$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/001-escape-simple-quote-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/001-escape-simple-quote-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}\'${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/001-escape-simple-quote-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}'${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/002-escape-simple-quote-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_STDERR'$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/002-escape-simple-quote-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout_and_stderr \'${GLOBAL_TOKEN}_STDOUT ${GLOBAL_TOKEN}_STDERR\' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/002-escape-simple-quote-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^'${GLOBAL_TOKEN}_STDOUT$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/003-escape-simple-quote-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/003-escape-simple-quote-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout '\' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/003-escape-simple-quote-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^\\$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/004-it-does-not-escape-simple-quote-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "^${GLOBAL_TOKEN}_STDERR\$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/004-it-does-not-escape-simple-quote-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "^${GLOBAL_TOKEN}_STDOUT\$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/005-it-does-not-escape-simple-quote-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/005-it-does-not-escape-simple-quote-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout \\'${GLOBAL_TOKEN}\\' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/escaping/005-it-does-not-escape-simple-quote-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^\\${GLOBAL_TOKEN}\\\\$" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout '{1..2}' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "[{]1..2}" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout {1..2}'{1..2}' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/002-it-does-not-expand-braces-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "1[{]1..2}@2[{]1..2}@" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout '{1..2}'{1..2} 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/003-it-does-not-expand-braces-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "[{]1..2}1@[{]1..2}2@" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5/stdin: -------------------------------------------------------------------------------- 1 | ./write_all_arguments_on_stdout '{1..2}' {1..2} '{1..2}' '{1..2}' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/brace-expansion/005-it-does-not-expand-braces-5/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "[{]1..2}@1@2@[{]1..2}@[{]1..2}@" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/001-it-works-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/001-it-works-1/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout ['a'] 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/001-it-works-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "[[]a]@" 2 | expected_to match_regex "^a@$" 3 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/002-it-works-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/002-it-works-2/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout ['a'bc'def'gh] 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/variable-expansion/001-expansion-disabled/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/variable-expansion/001-expansion-disabled/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/variable-expansion/001-expansion-disabled/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout '[$]${GLOBAL_TOKEN}_NAME' 2 | -------------------------------------------------------------------------------- /spec/42sh/quoting/simple-quotes/mixed/variable-expansion/001-expansion-disabled/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/001-tokens-are-recognized/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/001-tokens-are-recognized/stdin: -------------------------------------------------------------------------------- 1 | (./write_on_stdout ${GLOBAL_TOKEN}) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/001-tokens-are-recognized/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/002-multiple-levels-of-subshells/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that imbricating multiple subshells does not result in error. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/002-multiple-levels-of-subshells/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/002-multiple-levels-of-subshells/stdin: -------------------------------------------------------------------------------- 1 | ( ( ( ( ./write_on_stdout ${GLOBAL_TOKEN} ) ) ) ) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/002-multiple-levels-of-subshells/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/003-multiline/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the Shell implementation may parse a subshell command on multiple lines. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/003-multiline/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/003-multiline/stdin: -------------------------------------------------------------------------------- 1 | ( 2 | ./write_on_stdout ${GLOBAL_TOKEN}_SUBSHELL1 ; 3 | ./write_on_stdout ${GLOBAL_TOKEN}_SUBSHELL2 4 | ) 5 | -------------------------------------------------------------------------------- /spec/42sh/subshell/003-multiline/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_SUBSHELL1" 2 | expected_to match_regex "${GLOBAL_TOKEN}_SUBSHELL2" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/004-exit-status/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status 42 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/004-exit-status/stdin: -------------------------------------------------------------------------------- 1 | (./exit_with_status 42) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/005-copy-of-environment/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that a subshell get a copy of the parent environment. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/005-copy-of-environment/stdin: -------------------------------------------------------------------------------- 1 | (./display_env) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/001-parse-error-1/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the parser detects an invalid use of parentheses. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/001-parse-error-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/001-parse-error-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout (./write_on_stdout) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/001-parse-error-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "write_on_stdout" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/002-parse-error-2/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the parser detects an invalid use of parentheses. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/002-parse-error-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/002-parse-error-2/stdin: -------------------------------------------------------------------------------- 1 | (./write_on_stdout) (./write_on_stdout) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/002-parse-error-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "write_on_stdout" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/003-parse-error-3/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the parser detects an invalid use of parentheses. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/003-parse-error-3/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/003-parse-error-3/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ) (./write_on_stdout) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/003-parse-error-3/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "write_on_stdout" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/004-parse-error-4/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the parser detects an invalid use of parentheses. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/004-parse-error-4/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/004-parse-error-4/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ( (./write_on_stdout) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/errors/004-parse-error-4/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "write_on_stdout" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/cd/001-it-does-not-change-current-directory/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/cd/001-it-does-not-change-current-directory/stdin: -------------------------------------------------------------------------------- 1 | (cd /) 2 | ./display_pwd 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/cd/001-it-does-not-change-current-directory/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TMP_DIRECTORY}" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/cd/002-multiline/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/exit/001-exiting-subshell/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/setenv/001-it-does-not-modify-parent-environment/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_NAME" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/setenv/001-it-does-not-modify-parent-environment/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/unsetenv/001-it-does-not-modify-parent-environment/before_exec: -------------------------------------------------------------------------------- 1 | export "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/unsetenv/001-it-does-not-modify-parent-environment/stdin: -------------------------------------------------------------------------------- 1 | (unsetenv ${GLOBAL_TOKEN}_NAME ; unset ${GLOBAL_TOKEN}_NAME) 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/builtins/unsetenv/001-it-does-not-modify-parent-environment/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_NAME=${GLOBAL_TOKEN}_VALUE" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/escaping/001-escaped-subshell-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Cc]ommand not found|[Nn]o such file or directory)" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/escaping/001-escaped-subshell-1/stdin: -------------------------------------------------------------------------------- 1 | \(./write_on_stdout ${GLOBAL_TOKEN}_STDOUT\) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/escaping/001-escaped-subshell-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_STDOUT" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/escaping/002-escaped-subshell-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/escaping/002-escaped-subshell-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout \\\(${GLOBAL_TOKEN}_STDOUT\\\) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/escaping/002-escaped-subshell-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "\(${GLOBAL_TOKEN}_STDOUT\)" 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/inline-environment-variable/001-modifies-the-child-environment-only-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/inline-environment-variable/002-modifies-the-child-environment-only-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/piping/001-subshells-inside-piped-command/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/piping/002-pipes-inside-subshells/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that piped command may be executed inside a subshell command. 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/piping/002-pipes-inside-subshells/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/piping/003-imbricated-subshells-and-pipes/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/001-with-simple-quotes/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/001-with-simple-quotes/stdin: -------------------------------------------------------------------------------- 1 | (./write_on_stdout '${GLOBAL_TOKEN}_FIRST)' ; (./write_on_stdout '(${GLOBAL_TOKEN}_SECOND') ) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/001-with-simple-quotes/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_FIRST" 2 | expected_to match_regex "${GLOBAL_TOKEN}_SECOND" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/002-with-double-quotes/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/002-with-double-quotes/stdin: -------------------------------------------------------------------------------- 1 | (./write_on_stdout "${GLOBAL_TOKEN}_FIRST)" ; (./write_on_stdout "(${GLOBAL_TOKEN}_SECOND") ) 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/002-with-double-quotes/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_FIRST" 2 | expected_to match_regex "${GLOBAL_TOKEN}_SECOND" 3 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/003-with-simple-and-double-quotes/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/42sh/subshell/mixed/quoting/003-with-simple-and-double-quotes/stdin: -------------------------------------------------------------------------------- 1 | (./write_on_stdout "${GLOBAL_TOKEN}_FIRST)" ; (./write_on_stdout '(${GLOBAL_TOKEN}_SECOND') ) 2 | -------------------------------------------------------------------------------- /spec/README.md: -------------------------------------------------------------------------------- 1 | # spec 2 | 3 | * [21sh](./21sh) 4 | * [42sh](./42sh) 5 | * [bonuses](./bonuses) 6 | * [minishell](./minishell) 7 | -------------------------------------------------------------------------------- /spec/bonuses/builtins/README.md: -------------------------------------------------------------------------------- 1 | # builtins 2 | 3 | *[spec > bonuses](..) > builtins* 4 | 5 | * [env](./env) 6 | -------------------------------------------------------------------------------- /spec/bonuses/builtins/env/001-unset-variables/before_exec: -------------------------------------------------------------------------------- 1 | export TESTVARIABLE="${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/builtins/env/001-unset-variables/non-posix: -------------------------------------------------------------------------------- 1 | `env -u` is not registered in the POSIX standard. 2 | -------------------------------------------------------------------------------- /spec/bonuses/builtins/env/001-unset-variables/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/builtins/env/001-unset-variables/stdin: -------------------------------------------------------------------------------- 1 | env -u HOME -u PATH -u TESTVARIABLE ./display_env 2 | -------------------------------------------------------------------------------- /spec/bonuses/builtins/env/002-unset-and-set-variable/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/bonuses/builtins/env/002-unset-and-set-variable/stdin: -------------------------------------------------------------------------------- 1 | env -u HOME TESTVARIABLE=${GLOBAL_TOKEN} ./display_env 2 | -------------------------------------------------------------------------------- /spec/bonuses/builtins/env/002-unset-and-set-variable/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^TESTVARIABLE=${GLOBAL_TOKEN}$" 2 | expected_to_not match_regex "^HOME=" 3 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_VARIABLE" 2 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdin: -------------------------------------------------------------------------------- 1 | ${GLOBAL_TOKEN}_VARIABLE=${GLOBAL_TOKEN}_VALUE ./display_env 2 | ./display_env 3 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/001-modifies-child-environment-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}_VARIABLE=${GLOBAL_TOKEN}_VALUE$" once 2 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/before_exec: -------------------------------------------------------------------------------- 1 | unset "${GLOBAL_TOKEN}_VARIABLE" 2 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/002-modifies-child-environment-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/003-modifies-PATH-only/before_exec: -------------------------------------------------------------------------------- 1 | rm -rf "temporary_directory" 2 | mkdir -p "temporary_directory" 3 | cd "temporary_directory" 4 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/003-modifies-PATH-only/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "42" 2 | expected_to_not exit_with_status "0" 3 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Cc]ommand not found" 3 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdin: -------------------------------------------------------------------------------- 1 | PATH=.. write_on_stdout ${GLOBAL_TOKEN} 2 | exit_with_status 42 3 | -------------------------------------------------------------------------------- /spec/bonuses/inline-environment-variable/003-modifies-PATH-only/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^${GLOBAL_TOKEN}$" 2 | -------------------------------------------------------------------------------- /spec/bonuses/redirections/001-append-twice-outputs-together/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "new_file_stderr_and_stdout" 2 | -------------------------------------------------------------------------------- /spec/bonuses/redirections/001-append-twice-outputs-together/hard: -------------------------------------------------------------------------------- 1 | This test only succeed with the reference ZSH. 2 | -------------------------------------------------------------------------------- /spec/bonuses/redirections/001-append-twice-outputs-together/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stderr" 2 | -------------------------------------------------------------------------------- /spec/bonuses/redirections/001-append-twice-outputs-together/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}_stdout" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/README.md: -------------------------------------------------------------------------------- 1 | # separators 2 | 3 | *[spec > bonuses](..) > separators* 4 | 5 | * [and](./and) 6 | * [mixed](./mixed) 7 | * [or](./or) 8 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/001-run-twice/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the AND operator `&&` works with two valid commands. 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/001-run-twice/stderr: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/001-run-twice/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}_LEFT && ./write_on_stdout ${GLOBAL_TOKEN}_RIGHT 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/001-run-twice/stdout: -------------------------------------------------------------------------------- 1 | might match_regex "${GLOBAL_TOKEN}_LEFT" 2 | might match_regex "${GLOBAL_TOKEN}_RIGHT" 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/002-do-not-run-second/misc: -------------------------------------------------------------------------------- 1 | might exit_with_status "42" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/002-do-not-run-second/stderr: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/002-do-not-run-second/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 42 && ./write_on_stdout ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/002-do-not-run-second/stdout: -------------------------------------------------------------------------------- 1 | might_not match_regex ${GLOBAL_TOKEN} 2 | might be_empty 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/003-run-until-failing/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "42" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/003-run-until-failing/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/003-run-until-failing/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_FIRST" 2 | expected_to_not match_regex "${GLOBAL_TOKEN}_SECOND" 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/001-parse-error-at-beginning/misc: -------------------------------------------------------------------------------- 1 | might_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stderr: -------------------------------------------------------------------------------- 1 | might_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdin: -------------------------------------------------------------------------------- 1 | && ./write_on_stdout ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/001-parse-error-at-beginning/stdout: -------------------------------------------------------------------------------- 1 | might_not match_regex "${GLOBAL_TOKEN}" 2 | might be_empty 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stderr: -------------------------------------------------------------------------------- 1 | might_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN} &&& ./write_on_stdout ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/and/errors/002-parse-error-too-much-symbol/stdout: -------------------------------------------------------------------------------- 1 | might_not match_regex "${GLOBAL_TOKEN}" 2 | might be_empty 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/001-and-or/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/001-and-or/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/001-and-or/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 42 && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/001-and-or/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/002-and-or/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/002-and-or/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_ERROR" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/002-and-or/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 0 && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/002-and-or/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/003-and-or/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/003-and-or/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/003-and-or/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 0 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/003-and-or/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/004-or-and/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "21" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/004-or-and/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_ERROR" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/004-or-and/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 42 || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/004-or-and/stdout: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/005-or-and/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "21" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/005-or-and/stderr: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_ERROR" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/005-or-and/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 42 || ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS && ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/005-or-and/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/006-or-and/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/006-or-and/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/006-or-and/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 0 || ./write_on_stderr ${GLOBAL_TOKEN}_ERROR 21 && ./write_on_stdout ${GLOBAL_TOKEN}_SUCCESS 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/mixed/006-or-and/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_SUCCESS" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/001-run-first-only/stderr: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/001-run-first-only/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN}_LEFT || ./write_on_stdout ${GLOBAL_TOKEN}_RIGHT 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/001-run-first-only/stdout: -------------------------------------------------------------------------------- 1 | might match_regex ${GLOBAL_TOKEN}_LEFT 2 | might_not match_regex ${GLOBAL_TOKEN}_RIGHT 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/002-run-second-only/misc: -------------------------------------------------------------------------------- 1 | might exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/002-run-second-only/stderr: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/002-run-second-only/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 42 || ./write_on_stdout ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/002-run-second-only/stdout: -------------------------------------------------------------------------------- 1 | might match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/003-run-until-succeeding/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/003-run-until-succeeding/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/003-run-until-succeeding/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_FIRST" 2 | expected_to_not match_regex "${GLOBAL_TOKEN}_SECOND" 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/001-parse-error-at-beginning/misc: -------------------------------------------------------------------------------- 1 | might_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stderr: -------------------------------------------------------------------------------- 1 | might_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdin: -------------------------------------------------------------------------------- 1 | || ./write_on_stdout ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/001-parse-error-at-beginning/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/misc: -------------------------------------------------------------------------------- 1 | might_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stderr: -------------------------------------------------------------------------------- 1 | might_not be_empty 2 | might match_regex "([Ss]yntax|[Pp]arse) error" 3 | 4 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ${GLOBAL_TOKEN} ||| ./write_on_stdout ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/bonuses/separators/or/errors/002-parse-error-too-much-symbol/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ~ 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/001-expanded-with-HOME-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "~" 2 | expected_to match_regex "^/${GLOBAL_TOKEN}$" 3 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/002-expanded-with-HOME-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ~/${GLOBAL_TOKEN}_SUBDIRECTORY 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/003-expanded-with-PWD-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ~+ 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/004-expanded-with-PWD-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ~+/${GLOBAL_TOKEN}_SUBDIRECTORY 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/005-expanded-with-OLDPWD-1/stdin: -------------------------------------------------------------------------------- 1 | cd ./${GLOBAL_TOKEN}_SUBDIRECTORY 2 | ${GLOBAL_TMP_DIRECTORY}/write_on_stdout ~- 3 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ~~ 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/not-expanded/001-not-expanded-with-HOME-1/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^~~$" 2 | expected_to_not match_regex "/${GLOBAL_TOKEN}" 3 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/not-expanded/002-not-expanded-with-HOME-2/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ~${GLOBAL_TOKEN}_UNKNOWNUSER 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/before_exec: -------------------------------------------------------------------------------- 1 | export "HOME=/${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/bonuses/tilde-expansion/not-expanded/003-not-expanded-with-PWD/stdin: -------------------------------------------------------------------------------- 1 | ./write_on_stdout ~+${GLOBAL_TOKEN}_SUBDIRECTORY 2 | -------------------------------------------------------------------------------- /spec/minishell/README.md: -------------------------------------------------------------------------------- 1 | # minishell 2 | 3 | *[spec](..) > minishell* 4 | 5 | * [binary](./binary) 6 | * [builtins](./builtins) 7 | * [misc](./misc) 8 | -------------------------------------------------------------------------------- /spec/minishell/binary/001-binary-path-relative/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the Shell correctly finds binaries within the PATH. 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/001-binary-path-relative/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/001-binary-path-relative/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/001-binary-path-relative/stdin: -------------------------------------------------------------------------------- 1 | display_my_name1 2 | display_my_name2 3 | -------------------------------------------------------------------------------- /spec/minishell/binary/001-binary-path-relative/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "display_my_name1" 2 | expected_to match_regex "display_my_name2" 3 | -------------------------------------------------------------------------------- /spec/minishell/binary/002-binary-path-absolute/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the Shell correctly finds binaries through their absolute path. 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/002-binary-path-absolute/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/002-binary-path-absolute/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/002-binary-path-absolute/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_1" 2 | expected_to match_regex "${GLOBAL_TOKEN}_2" 3 | -------------------------------------------------------------------------------- /spec/minishell/binary/003-binary-test-exec-order/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/003-binary-test-exec-order/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/003-binary-test-exec-order/stdin: -------------------------------------------------------------------------------- 1 | fake_echo ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/003-binary-test-exec-order/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex ${GLOBAL_TOKEN} 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/004-binary-test-empty-path/before_exec: -------------------------------------------------------------------------------- 1 | export PATH="" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/004-binary-test-empty-path/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/004-binary-test-empty-path/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/004-binary-test-empty-path/stdin: -------------------------------------------------------------------------------- 1 | write_on_stdout "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/004-binary-test-empty-path/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/005-binary-test-wrong-path/before_exec: -------------------------------------------------------------------------------- 1 | export PATH="/" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/005-binary-test-wrong-path/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/005-binary-test-wrong-path/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Cc]ommand not found" 3 | -------------------------------------------------------------------------------- /spec/minishell/binary/005-binary-test-wrong-path/stdin: -------------------------------------------------------------------------------- 1 | ls 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/005-binary-test-wrong-path/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/006-binary-undefined-path/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/006-binary-undefined-path/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/006-binary-undefined-path/stdin: -------------------------------------------------------------------------------- 1 | ls 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/006-binary-undefined-path/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}_006-BINARY-UNDEFINED-PATH" 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/007-binary-permission-denied/after_exec: -------------------------------------------------------------------------------- 1 | if [ -d "./permission_denied" ]; then chmod 777 "./permission_denied"; fi 2 | rm -rf "./permission_denied" 3 | -------------------------------------------------------------------------------- /spec/minishell/binary/007-binary-permission-denied/before_exec: -------------------------------------------------------------------------------- 1 | rm -rf ./permission_denied 2 | touch ./permission_denied 3 | chmod 0 ./permission_denied 4 | -------------------------------------------------------------------------------- /spec/minishell/binary/007-binary-permission-denied/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status 0 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/007-binary-permission-denied/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Pp]ermission denied" 3 | -------------------------------------------------------------------------------- /spec/minishell/binary/007-binary-permission-denied/stdin: -------------------------------------------------------------------------------- 1 | ./permission_denied 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/007-binary-permission-denied/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/008-binary-too-many-symbolic-links-encountered/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status 0 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/008-binary-too-many-symbolic-links-encountered/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Tt]oo many.*symbolic links" 3 | -------------------------------------------------------------------------------- /spec/minishell/binary/008-binary-too-many-symbolic-links-encountered/stdin: -------------------------------------------------------------------------------- 1 | ./symbolic_link1 2 | -------------------------------------------------------------------------------- /spec/minishell/binary/008-binary-too-many-symbolic-links-encountered/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/001-no-arg/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/001-no-arg/stdin: -------------------------------------------------------------------------------- 1 | cd 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/001-no-arg/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TMP_DIRECTORY}$" 2 | expected_to match_regex "PWD:${HOME}:PWD" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/002-current-directory/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/002-current-directory/stdin: -------------------------------------------------------------------------------- 1 | cd . 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/003-current-directory-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/003-current-directory-2/stdin: -------------------------------------------------------------------------------- 1 | cd ../tmp 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/004-parent-directory/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/004-parent-directory/stdin: -------------------------------------------------------------------------------- 1 | cd .. 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/004-parent-directory/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_INSTALLDIR}:PWD$" 2 | expected_to match_regex "^PWD=${GLOBAL_INSTALLDIR}$" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/005-root-path/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/005-root-path/stdin: -------------------------------------------------------------------------------- 1 | cd / 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/005-root-path/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:/:PWD" 2 | expected_to match_regex "^PWD=/$" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/006-root-path-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/006-root-path-2/stdin: -------------------------------------------------------------------------------- 1 | cd /. 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/006-root-path-2/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:/:PWD" 2 | expected_to match_regex "^PWD=/$" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/007-symbolic-link/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "./symbolic_link" 2 | mkdir -p "./sub_directory" 3 | ln -s "./sub_directory" "./symbolic_link" 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/007-symbolic-link/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/007-symbolic-link/stdin: -------------------------------------------------------------------------------- 1 | cd symbolic_link 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/008-symbolic-link-2/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/008-symbolic-link-2/stdin: -------------------------------------------------------------------------------- 1 | cd symbolic_link2 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/009-following-links/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/009-following-links/stdin: -------------------------------------------------------------------------------- 1 | cd sub_directory_link 2 | cd sub_sub_directory_link 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/009-following-links/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "^PWD=${GLOBAL_TMP_DIRECTORY}/sub_directory_link/sub_sub_directory_link" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/010-update-OLDPWD/before_exec: -------------------------------------------------------------------------------- 1 | rm -rf "${GLOBAL_TOKEN}" 2 | mkdir -p "./${GLOBAL_TOKEN}/${GLOBAL_TOKEN}" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/010-update-OLDPWD/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/010-update-OLDPWD/stdin: -------------------------------------------------------------------------------- 1 | cd ${GLOBAL_TOKEN} 2 | cd ${GLOBAL_TOKEN} 3 | ../../display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/011-dotdot/before_exec: -------------------------------------------------------------------------------- 1 | rm -rf "playing_with_dotdot" 2 | mkdir -p "playing_with_dotdot/1/2/3/4/5/6/7/8/9/10" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/011-dotdot/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/012-dot/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/012-dot/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | expected_to match_regex "^PWD=${GLOBAL_TMP_DIRECTORY}$" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/013-absolute-path/before_exec: -------------------------------------------------------------------------------- 1 | rm -rf "./my_sub_directory" 2 | mkdir -p "./my_sub_directory/and_another_one/" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/013-absolute-path/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/001-not-a-directory/before_exec: -------------------------------------------------------------------------------- 1 | touch "./not_a_directory" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/001-not-a-directory/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Nn]ot a directory" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/001-not-a-directory/stdin: -------------------------------------------------------------------------------- 1 | cd not_a_directory 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/001-not-a-directory/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/002-not-a-directory-2/before_exec: -------------------------------------------------------------------------------- 1 | touch "./not_a_directory" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/002-not-a-directory-2/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/002-not-a-directory-2/stdin: -------------------------------------------------------------------------------- 1 | cd not_a_directory 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/003-permission-denied/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Pp]ermission denied" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/003-permission-denied/stdin: -------------------------------------------------------------------------------- 1 | cd permission_denied 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/003-permission-denied/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/004-permission-denied-2/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/004-permission-denied-2/stdin: -------------------------------------------------------------------------------- 1 | cd permission_denied 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/005-too-many-symbolic-links-encountered/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Tt]oo many.*symbolic links" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/005-too-many-symbolic-links-encountered/stdin: -------------------------------------------------------------------------------- 1 | cd symbolic_link1 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/005-too-many-symbolic-links-encountered/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/006-too-many-symbolic-links-encountered-2/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/006-too-many-symbolic-links-encountered-2/stdin: -------------------------------------------------------------------------------- 1 | cd symbolic_link1 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/007-no-such-file-or-directory/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "./no_such_file_or_directory" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/007-no-such-file-or-directory/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Nn]o such file or directory" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/007-no-such-file-or-directory/stdin: -------------------------------------------------------------------------------- 1 | cd no_such_file_or_directory 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/007-no-such-file-or-directory/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/008-no-such-file-or-directory-2/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "./no_such_file_or_directory" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/008-no-such-file-or-directory-2/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/008-no-such-file-or-directory-2/stdin: -------------------------------------------------------------------------------- 1 | cd no_such_file_or_directory 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/009-no-such-file-or-directory-symlink/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Nn]o such file or directory" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/009-no-such-file-or-directory-symlink/stdin: -------------------------------------------------------------------------------- 1 | cd ./enoent_symlink 2 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/009-no-such-file-or-directory-symlink/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/010-no-such-file-or-directory-symlink-2/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/errors/010-no-such-file-or-directory-symlink-2/stdin: -------------------------------------------------------------------------------- 1 | cd ./enoent_symlink 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/options/001-not-following-links/stderr: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/options/001-not-following-links/stdin: -------------------------------------------------------------------------------- 1 | cd -P sub_directory_link 2 | cd -P sub_sub_directory_link 3 | ${GLOBAL_TMP_DIRECTORY}/display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/options/001-not-following-links/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD=${GLOBAL_TMP_DIRECTORY}/sub_directory/sub_sub_directory" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/options/002-oldpwd/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/options/002-oldpwd/stdin: -------------------------------------------------------------------------------- 1 | cd / 2 | cd - 3 | ${GLOBAL_TMP_DIRECTORY}/display_pwd 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/cd/options/002-oldpwd/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "PWD:${GLOBAL_TMP_DIRECTORY}:PWD" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/001-env-same-value-as-parent/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/env/001-env-same-value-as-parent/stdin: -------------------------------------------------------------------------------- 1 | env -------------------------------------------------------------------------------- /spec/minishell/builtins/env/001-env-same-value-as-parent/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_each_regex_of_file "./stored_env" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/002-env-check-usefull-var/before_exec: -------------------------------------------------------------------------------- 1 | export TEST_42SHTEST="${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/002-env-check-usefull-var/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/env/002-env-check-usefull-var/stdin: -------------------------------------------------------------------------------- 1 | env -------------------------------------------------------------------------------- /spec/minishell/builtins/env/003-ignore-environment/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/env/003-ignore-environment/stdin: -------------------------------------------------------------------------------- 1 | env -i ./display_env 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/003-ignore-environment/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "TOTAL ENVIRONMENT VARIABLES: 0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/005-set-variables/before_exec: -------------------------------------------------------------------------------- 1 | export VARTEST1="OLD_VALUE" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/005-set-variables/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/env/005-set-variables/stdin: -------------------------------------------------------------------------------- 1 | env VARTEST1=${GLOBAL_TOKEN}_1 VARTEST2=${GLOBAL_TOKEN}_2 VARTEST3=${GLOBAL_TOKEN}_3 ./display_env 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/001-command-not-found/before_exec: -------------------------------------------------------------------------------- 1 | rm -f "./invalid_binary" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/001-command-not-found/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/001-command-not-found/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "[Cc]ommand not found" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/001-command-not-found/stdin: -------------------------------------------------------------------------------- 1 | env ./invalid_binary 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/002-illegal-option/before_exec: -------------------------------------------------------------------------------- 1 | rm -f -- "-w" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/002-illegal-option/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/002-illegal-option/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Ii]nvalid|[Ii]llegal) (option|argument)" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/errors/002-illegal-option/stdin: -------------------------------------------------------------------------------- 1 | env -w 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/env/multiple-options/001-ignore-environment-and-set-variable/stderr: -------------------------------------------------------------------------------- 1 | expected_to be_empty -------------------------------------------------------------------------------- /spec/minishell/builtins/env/multiple-options/001-ignore-environment-and-set-variable/stdin: -------------------------------------------------------------------------------- 1 | env -i TESTVARIABLE=${GLOBAL_TOKEN} ./display_env 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/001-without-any-argument/description: -------------------------------------------------------------------------------- 1 | The purpose of this test is to check that the builtin `exit` works and exit the Shell. 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/001-without-any-argument/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/001-without-any-argument/stdin: -------------------------------------------------------------------------------- 1 | exit 2 | ./write_on_stdout "${GLOBAL_TOKEN}" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/001-without-any-argument/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/002-status-passed-as-argument/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "42" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/002-status-passed-as-argument/stdin: -------------------------------------------------------------------------------- 1 | exit 42 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/002-status-passed-as-argument/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/003-status-of-last-command/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "42" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/003-status-of-last-command/stdin: -------------------------------------------------------------------------------- 1 | ./exit_with_status 42 2 | exit 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/003-status-of-last-command/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/001-too-many-args/misc: -------------------------------------------------------------------------------- 1 | expected_to exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/001-too-many-args/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "([Tt]oo many arguments|[Aa]rgument list too long)" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/001-too-many-args/stdin: -------------------------------------------------------------------------------- 1 | exit 21 42 2 | ./write_on_stdout ${GLOBAL_TOKEN} 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/001-too-many-args/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/002-non-numeric-argument/misc: -------------------------------------------------------------------------------- 1 | expected_to_not exit_with_status "0" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/002-non-numeric-argument/stderr: -------------------------------------------------------------------------------- 1 | might_not be_empty 2 | might match_regex "[Nn]umeric argument required" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/002-non-numeric-argument/stdin: -------------------------------------------------------------------------------- 1 | exit abc 2 | ./write_on_stdout ${GLOBAL_TOKEN} 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/exit/errors/002-non-numeric-argument/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/mixed/001-setenv-unsetenv/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "TEST1=" 2 | expected_to_not match_regex "TEST2=" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/mixed/README.md: -------------------------------------------------------------------------------- 1 | # mixed 2 | 3 | *[spec > minishell > builtins](..) > mixed* 4 | 5 | * [001-setenv-unsetenv](./001-setenv-unsetenv) 6 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/001-no-argument/stdin: -------------------------------------------------------------------------------- 1 | setenv 2 | export 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/001-no-argument/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_each_regex_of_file "./stored_env" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/002-add-new-variable/before_exec: -------------------------------------------------------------------------------- 1 | unset "TESTVAR1" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/002-add-new-variable/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "TESTVAR1=VALUE_${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/003-set-existing-variable/before_exec: -------------------------------------------------------------------------------- 1 | export "TESTVAR1=OLD_${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/003-set-existing-variable/stdout: -------------------------------------------------------------------------------- 1 | expected_to match_regex "TESTVAR1=NEW_${GLOBAL_TOKEN}" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/004-invalid-identifier/stderr: -------------------------------------------------------------------------------- 1 | expected_to_not be_empty 2 | might match_regex "(not.*identifier|must begin.*letter)" 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/004-invalid-identifier/stdin: -------------------------------------------------------------------------------- 1 | setenv 42 2 | export 42 3 | -------------------------------------------------------------------------------- /spec/minishell/builtins/setenv/004-invalid-identifier/stdout: -------------------------------------------------------------------------------- 1 | might be_empty 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/unsetenv/001-unsetenv-first-elem/stdin: -------------------------------------------------------------------------------- 1 | unsetenv VARTEST 2 | unset VARTEST 3 | ./display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/builtins/unsetenv/001-unsetenv-first-elem/stdout: -------------------------------------------------------------------------------- 1 | expected_to_not match_regex "VARTEST=" 2 | -------------------------------------------------------------------------------- /spec/minishell/builtins/unsetenv/003-unsetenv-mult-envp-inline/stdin: -------------------------------------------------------------------------------- 1 | unsetenv ONE TWO THREE 2 | unset ONE TWO THREE 3 | ./display_env 4 | -------------------------------------------------------------------------------- /spec/minishell/misc/001-copy-of-environment/description: -------------------------------------------------------------------------------- 1 | A Shell must send a copy of the environment to its child processes. 2 | -------------------------------------------------------------------------------- /spec/minishell/misc/001-copy-of-environment/stdin: -------------------------------------------------------------------------------- 1 | ./display_env 2 | -------------------------------------------------------------------------------- /spec/minishell/misc/README.md: -------------------------------------------------------------------------------- 1 | # misc 2 | 3 | *[spec > minishell](..) > misc* 4 | 5 | * [001-copy-of-environment](./001-copy-of-environment) 6 | -------------------------------------------------------------------------------- /support/display-env/description: -------------------------------------------------------------------------------- 1 | A binary that iterates on `**envp` and write each element on standard output. 2 | -------------------------------------------------------------------------------- /support/display-program-name/description: -------------------------------------------------------------------------------- 1 | A binary that writes its name on standard ouput. 2 | -------------------------------------------------------------------------------- /support/exit-with-status/description: -------------------------------------------------------------------------------- 1 | A binary that immediately exits with the status given as first argument. 2 | --------------------------------------------------------------------------------