diff --git a/42sh/42shelltest-tmp/log b/42sh/42shelltest-tmp/log index a0683387..e790f518 100644 --- a/42sh/42shelltest-tmp/log +++ b/42sh/42shelltest-tmp/log @@ -1,4 +1,4 @@ -.x..........................xx....x.xxxxxxxxxx~~xxx.xxx......xx......xxxxxxxxxx.......xxxxxxxxxxxxxxx.xx~xx..x~..x..x..xxxx.xx.xxx.x......xxxx.xxxx.....x..x...........xxxx..................................xx..x...xxx...~x.........~~..xxxxxxxx...x.x.~......xx....~.~.~.........xxxxx...xx....x..... +.x..........................xx....x.x.xxx....xxxxxx.xxx......xxxxx...xxxxxxxxxx.......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxx.xx.xxx.x......xxxx.xxxxxx...xxxx...........xxxxxx.................xx.................xx..x...xxx...~x.........~~..xxxxxxxx...x.x.~......xx....~.~.~.........x.x.x...xx....x..... ---------------------------------------------------------------- @@ -9,16 +9,16 @@ Before test:  01: rm -rf "./size" - 02: rm -rf "TOKEN201703172323" - 03: echo '^'$(echo TOKEN201703172323_FILE_TOKEN201703172323_STDOUT | wc -c)'$' > "./size" + 02: rm -rf "TOKEN201703181458" + 03: echo '^'$(echo TOKEN201703181458_FILE_TOKEN201703181458_STDOUT | wc -c)'$' > "./size" STDIN: - 01: mkdir TOKEN201703172323 ; cd TOKEN201703172323 ; touch TOKEN201703172323_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703172323_STDOUT ; cat TOKEN201703172323_STDOUT + 01: mkdir TOKEN201703181458 ; cd TOKEN201703181458 ; touch TOKEN201703181458_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703181458_STDOUT ; cat TOKEN201703181458_STDOUT STDOUT: - SUCCESS expected_to match_regex `TOKEN201703172323_FILE$` + SUCCESS expected_to match_regex `TOKEN201703181458_FILE$`  FAILURE expected_to match_each_regex_of_file `./size` - 01: TOKEN201703172323_FILE + 01: TOKEN201703181458_FILE 02: 23 STDERR: @@ -36,21 +36,21 @@  01: rm -f "new_file_stderr_and_stdout" STDIN: - 01: ./write_on_stdout_and_stderr TOKEN201703172323_1 TOKEN201703172323_2 &>new_file_stderr_and_stdout + 01: ./write_on_stdout_and_stderr TOKEN201703181458_1 TOKEN201703181458_2 &>new_file_stderr_and_stdout STDOUT: - FAILURE expected_to_not match_regex `TOKEN201703172323_1` - SUCCESS expected_to_not match_regex `TOKEN201703172323_2` - 01: TOKEN201703172323_1 + FAILURE expected_to_not match_regex `TOKEN201703181458_1` + SUCCESS expected_to_not match_regex `TOKEN201703181458_2` + 01: TOKEN201703181458_1 STDERR: - SUCCESS expected_to_not match_regex `TOKEN201703172323_1` - FAILURE expected_to_not match_regex `TOKEN201703172323_2` - 01: TOKEN201703172323_2 + SUCCESS expected_to_not match_regex `TOKEN201703181458_1` + FAILURE expected_to_not match_regex `TOKEN201703181458_2` + 01: TOKEN201703181458_2 MISC: - FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703172323_1$` - FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703172323_2$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703181458_1$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703181458_2$` ---------------------------------------------------------------- @@ -64,21 +64,21 @@  01: rm -f new_file_stderr_and_stdout STDIN: - 01: ./write_on_stdout_and_stderr TOKEN201703172323_1 TOKEN201703172323_2 &> new_file_stderr_and_stdout + 01: ./write_on_stdout_and_stderr TOKEN201703181458_1 TOKEN201703181458_2 &> new_file_stderr_and_stdout STDOUT: - FAILURE expected_to_not match_regex `TOKEN201703172323_1` - SUCCESS expected_to_not match_regex `TOKEN201703172323_2` - 01: TOKEN201703172323_1 + FAILURE expected_to_not match_regex `TOKEN201703181458_1` + SUCCESS expected_to_not match_regex `TOKEN201703181458_2` + 01: TOKEN201703181458_1 STDERR: - SUCCESS expected_to_not match_regex `TOKEN201703172323_1` - FAILURE expected_to_not match_regex `TOKEN201703172323_2` - 01: TOKEN201703172323_2 + SUCCESS expected_to_not match_regex `TOKEN201703181458_1` + FAILURE expected_to_not match_regex `TOKEN201703181458_2` + 01: TOKEN201703181458_2 MISC: - FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703172323_1$` - FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703172323_2$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703181458_1$` + FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703181458_2$` ---------------------------------------------------------------- @@ -88,7 +88,7 @@  The purpose of this test is to check that using the simicolon separator `;` with empty commands results in error. STDIN: - 01: ./write_on_stdout TOKEN201703172323 ; ; ./exit_with_status 42 + 01: ./write_on_stdout TOKEN201703181458 ; ; ./exit_with_status 42 STDOUT:  SUCCESS expected_to be_empty @@ -127,47 +127,25 @@ ---------------------------------------------------------------- -42sh/builtins/export/002-export-basic-key-value-1 (FAILED) - - Description: - The purpose of this test is to check that the builtin `export` may declare a new environment variable. - - Before test: - 01: unset "TOKEN201703172323_NAME" - - STDIN: - 01: export TOKEN201703172323_NAME=TOKEN201703172323_VALUE - 02: ./display_env - - STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE$` - (no output) - - STDERR: - FAILURE expected_to be_empty - 01: ./lib/main.sh: line 102: 66973 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh - ----------------------------------------------------------------- - 42sh/builtins/export/003-export-basic-key-value-2 (FAILED) Description:  The purpose of this test is to check that the builtin `export` may declare a new environment variable and is able to display it later. Before test: - 01: unset "TOKEN201703172323_NAME" + 01: unset "TOKEN201703181458_NAME" STDIN: - 01: export TOKEN201703172323_NAME=TOKEN201703172323_VALUE + 01: export TOKEN201703181458_NAME=TOKEN201703181458_VALUE 02: export STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323_NAME=["]?TOKEN201703172323_VALUE["]?$` + FAILURE expected_to match_regex `TOKEN201703181458_NAME=["]?TOKEN201703181458_VALUE["]?$`  (no output) STDERR: - FAILURE expected_to be_empty - 01: ./lib/main.sh: line 102: 67097 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh + SUCCESS expected_to be_empty + (no output) ---------------------------------------------------------------- @@ -177,51 +155,51 @@  The purpose of this test is to check that exporting an empty variable does not add it to the environment. Before test: - 01: unset "TOKEN201703172323" + 01: unset "TOKEN201703181458" STDIN: - 01: export TOKEN201703172323 + 01: export TOKEN201703181458 02: ./display_env STDOUT: - FAILURE expected_to_not match_regex `TOKEN201703172323` + FAILURE expected_to_not match_regex `TOKEN201703181458`  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 08: TERM_PROGRAM_VERSION=3.0.10 - 09: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 09: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 10: ZSH=/Users/ariard/.oh-my-zsh 11: USER=ariard - 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 14: PAGER=less - 15: TMUX=/private/tmp/tmux-18965/default,83855,1 + 15: TMUX=/private/tmp/tmux-18965/default,63199,0 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 17: LSCOLORS=Gxfxcxdxbxegedabagacad 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 19: MAIL=ariard@student.42.fr - 20: PWD=/Users/ariard/42shelltest-tmp/tmp + 20: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 21: LANG=en_US.UTF-8 22: ITERM_PROFILE=Default 23: XPC_FLAGS=0x0 - 24: TMUX_PANE=%8 + 24: TMUX_PANE=%2 25: XPC_SERVICE_NAME=0 26: SHLVL=4 27: HOME=/Users/ariard 28: COLORFGBG=7;0 - 29: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 29: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 30: LOGNAME=ariard 31: LESS=-R 32: LC_CTYPE=en_US.UTF-8 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 34: OLDPWD=/Users/ariard/42shelltest-tmp - 35: _=/Users/ariard/Projects/42sh/42sh + 34: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 35: _=../../42sh 36: ?=0 - 37: TOKEN201703172323= + 37: TOKEN201703181458= 38: ------------------------------ 39: TOTAL ENVIRONMENT VARIABLES: 36 @@ -237,14 +215,14 @@  The purpose of this test is to check that exporting an empty variable does not add it to the environment, but can be displayed with the builtin `export`. Before test: - 01: unset "TOKEN201703172323" + 01: unset "TOKEN201703181458" STDIN: - 01: export TOKEN201703172323 + 01: export TOKEN201703181458 02: export STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323` + FAILURE expected_to match_regex `TOKEN201703181458`  (no output) STDERR: @@ -253,158 +231,69 @@ ---------------------------------------------------------------- -42sh/builtins/export/006-export-update-env-variable (FAILED) - - Description: - The purpose of this test is to check that exporting the same variable twice in a row does result in an updated variable, but not in a duplicated variable. - - Before test: - 01: unset "TOKEN201703172323_NAME" - - STDIN: - 01: export TOKEN201703172323_NAME=TOKEN201703172323_VALUE1 - 02: export TOKEN201703172323_NAME=TOKEN201703172323_VALUE2 - 03: ./display_env - - STDOUT: - SUCCESS expected_to_not match_regex `TOKEN201703172323_NAME=TOKEN201703172323_VALUE1` - FAILURE expected_to match_regex `TOKEN201703172323_NAME=TOKEN201703172323_VALUE2` - (no output) - - STDERR: - FAILURE expected_to be_empty - 01: ./lib/main.sh: line 102: 67471 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh - ----------------------------------------------------------------- - -42sh/builtins/export/007-existing-environment-variable (FAILED) - - Description: - The purpose of this test is to check that exporting an existing variable results in an updated variable. - - Before test: - 01: export "TOKEN201703172323_NAME=TOKEN201703172323_VALUE1" - - STDIN: - 01: export TOKEN201703172323_NAME=TOKEN201703172323_VALUE2 - 02: ./display_env - - STDOUT: - SUCCESS expected_to_not match_regex `TOKEN201703172323_NAME=TOKEN201703172323_VALUE1` - FAILURE expected_to match_regex `TOKEN201703172323_NAME=TOKEN201703172323_VALUE2` - (no output) - - STDERR: - FAILURE expected_to be_empty - 01: ./lib/main.sh: line 102: 67610 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh - ----------------------------------------------------------------- - -42sh/builtins/export/008-local-to-environment (FAILED) - - Description: - The purpose of this test is to check that a declared local variable may be exported to the environment with the builtin `export`. - - STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_VALUE - 02: export TOKEN201703172323_NAME - 03: ./display_env - - STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE$` - (no output) - - STDERR: - FAILURE expected_to be_empty - 01: ./lib/main.sh: line 102: 67739 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh - ----------------------------------------------------------------- - -42sh/builtins/export/009-export-with-equal-but-no-value-part1 (FAILED) - - Description: - The purpose of this test is to check if the builtin export works fine with equal sign but no value. This test is based on the environment variables return. - - Before test: - 01: unset "TOKEN201703172323" - - STDIN: - 01: export TOKEN201703172323_NAME= - 02: ./display_env - - STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=` - (no output) - - STDERR: - FAILURE expected_to be_empty - 01: ./lib/main.sh: line 102: 67860 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh - ----------------------------------------------------------------- - 42sh/builtins/export/010-export-with-equal-but-no-value-part2 (FAILED) Description:  The purpose of this test is to check if the builtin export works fine with equal sign but no value. This test is based on the local variables return. Before test: - 01: unset "TOKEN201703172323" + 01: unset "TOKEN201703181458" STDIN: - 01: export TOKEN201703172323_NAME= + 01: export TOKEN201703181458_NAME= 02: export STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323_NAME=` + FAILURE expected_to match_regex `TOKEN201703181458_NAME=`  (no output) STDERR: - FAILURE expected_to be_empty - 01: ./lib/main.sh: line 102: 67984 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh + SUCCESS expected_to be_empty + (no output) ---------------------------------------------------------------- -42sh/builtins/export/errors/001-invalid-identifier-1 (WARNING) +42sh/builtins/export/errors/001-invalid-identifier-1 (FAILED) Description:  The purpose of this test is to check that trying to export an invalid variable identifier results in error. STDIN: - 01: export 42=TOKEN201703172323 + 01: export 42=TOKEN201703181458 STDOUT: - SUCCESS expected_to_not match_regex `TOKEN201703172323` + SUCCESS expected_to_not match_regex `TOKEN201703181458`  (no output) STDERR: - SUCCESS expected_to_not be_empty + FAILURE expected_to_not be_empty  WARNING might match_regex `(not.*identifier|must begin.*letter)` - 01: ./lib/main.sh: line 102: 68103 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh + (no output) MISC: - SUCCESS expected_to_not exit_with_status `0` + FAILURE expected_to_not exit_with_status `0` ---------------------------------------------------------------- -42sh/builtins/export/errors/002-invalid-identifier-2 (WARNING) +42sh/builtins/export/errors/002-invalid-identifier-2 (FAILED) Description:  The purpose of this test is to check that trying to export an invalid variable identifier results in error. STDIN: - 01: export .=TOKEN201703172323 + 01: export .=TOKEN201703181458 STDOUT: - SUCCESS expected_to_not match_regex `TOKEN201703172323` + SUCCESS expected_to_not match_regex `TOKEN201703181458`  (no output) STDERR: - SUCCESS expected_to_not be_empty + FAILURE expected_to_not be_empty  WARNING might match_regex `(not.*identifier|must begin.*letter)` - 01: ./lib/main.sh: line 102: 68240 Segmentation fault: 11 /Users/ariard/Projects/42sh/42sh + (no output) MISC: - SUCCESS expected_to_not exit_with_status `0` + FAILURE expected_to_not exit_with_status `0` ---------------------------------------------------------------- @@ -422,7 +311,7 @@ STDERR:  SUCCESS expected_to_not be_empty  SUCCESS might match_regex `([Ii]nvalid|[Ii]llegal) (option|argument)` - 01: /Users/ariard/Projects/42sh/42sh: invalid option -w + 01: ../../42sh: invalid option -w MISC:  FAILURE expected_to_not exit_with_status `0` @@ -435,19 +324,19 @@  The purpose of this test is to check that modifying the environment for the builtin `export` results in an added variable into the exported list. Before test: - 01: unset "TOKEN201703172323_NAME" + 01: unset "TOKEN201703181458_NAME" STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_VALUE export TOKEN201703172323_NAME + 01: TOKEN201703181458_NAME=TOKEN201703181458_VALUE export TOKEN201703181458_NAME 02: export STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323_NAME=["]?TOKEN201703172323_VALUE["]?` + FAILURE expected_to match_regex `TOKEN201703181458_NAME=["]?TOKEN201703181458_VALUE["]?`  (no output) STDERR:  FAILURE expected_to be_empty - 01: minishell: command not found: TOKEN201703172323_NAME=TOKEN201703172323_VALUE + 01: minishell: command not found: TOKEN201703181458_NAME=TOKEN201703181458_VALUE ---------------------------------------------------------------- @@ -457,56 +346,56 @@  The purpose of this test is to check that modifying the environment for the builtin `export` results in an added environment variable. Before test: - 01: unset "TOKEN201703172323_NAME" + 01: unset "TOKEN201703181458_NAME" STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_VALUE export TOKEN201703172323_NAME + 01: TOKEN201703181458_NAME=TOKEN201703181458_VALUE export TOKEN201703181458_NAME 02: ./display_env STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323_NAME=TOKEN201703172323_VALUE` + FAILURE expected_to match_regex `TOKEN201703181458_NAME=TOKEN201703181458_VALUE`  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 08: TERM_PROGRAM_VERSION=3.0.10 - 09: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 09: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 10: ZSH=/Users/ariard/.oh-my-zsh 11: USER=ariard - 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 14: PAGER=less - 15: TMUX=/private/tmp/tmux-18965/default,83855,1 + 15: TMUX=/private/tmp/tmux-18965/default,63199,0 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 17: LSCOLORS=Gxfxcxdxbxegedabagacad 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 19: MAIL=ariard@student.42.fr - 20: PWD=/Users/ariard/42shelltest-tmp/tmp + 20: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 21: LANG=en_US.UTF-8 22: ITERM_PROFILE=Default 23: XPC_FLAGS=0x0 - 24: TMUX_PANE=%8 + 24: TMUX_PANE=%2 25: XPC_SERVICE_NAME=0 26: SHLVL=4 27: HOME=/Users/ariard 28: COLORFGBG=7;0 - 29: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 29: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 30: LOGNAME=ariard 31: LESS=-R 32: LC_CTYPE=en_US.UTF-8 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 34: OLDPWD=/Users/ariard/42shelltest-tmp - 35: _=/Users/ariard/Projects/42sh/42sh + 34: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 35: _=../../42sh 36: ?=127 37: ------------------------------ 38: TOTAL ENVIRONMENT VARIABLES: 35 STDERR:  FAILURE expected_to be_empty - 01: minishell: command not found: TOKEN201703172323_NAME=TOKEN201703172323_VALUE + 01: minishell: command not found: TOKEN201703181458_NAME=TOKEN201703181458_VALUE ---------------------------------------------------------------- @@ -517,50 +406,50 @@ Before test:  01: rm -f "./stored_env" - 02: unset "TOKEN201703172323_NAME" + 02: unset "TOKEN201703181458_NAME" 03: export | awk 'BEGIN {FS="="} $0 !~ /^(OLDPWD|_)/ {print $1"="}' > "./stored_env" STDIN: - 01: export -p TOKEN201703172323_NAME + 01: export -p TOKEN201703181458_NAME 02: export STDOUT:  FAILURE expected_to_not match_each_regex_of_file `./stored_env` - FAILURE expected_to match_regex `TOKEN201703172323_NAME` + FAILURE expected_to match_regex `TOKEN201703181458_NAME`  01: export TERM_PROGRAM=iTerm.app 02: export TERM=screen-256color 03: export SHELL=/bin/zsh 04: export HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 05: export TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 06: export Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 06: export Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 07: export TERM_PROGRAM_VERSION=3.0.10 - 08: export TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 08: export TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 09: export ZSH=/Users/ariard/.oh-my-zsh 10: export USER=ariard - 11: export SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 11: export SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 12: export __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 13: export PAGER=less - 14: export TMUX=/private/tmp/tmux-18965/default,83855,1 + 14: export TMUX=/private/tmp/tmux-18965/default,63199,0 15: export HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 16: export LSCOLORS=Gxfxcxdxbxegedabagacad 17: export PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 18: export MAIL=ariard@student.42.fr - 19: export PWD=/Users/ariard/42shelltest-tmp/tmp + 19: export PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 20: export LANG=en_US.UTF-8 21: export ITERM_PROFILE=Default 22: export XPC_FLAGS=0x0 - 23: export TMUX_PANE=%8 + 23: export TMUX_PANE=%2 24: export XPC_SERVICE_NAME=0 25: export SHLVL=4 26: export HOME=/Users/ariard 27: export COLORFGBG=7;0 - 28: export ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 28: export ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 29: export LOGNAME=ariard 30: export LESS=-R 31: export LC_CTYPE=en_US.UTF-8 32: export TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 33: export OLDPWD=/Users/ariard/42shelltest-tmp - 34: export _=/Users/ariard/Projects/42sh/42sh + 33: export OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 34: export _=../../42sh 35: export ?=0 STDERR: @@ -576,50 +465,50 @@ Before test:  01: rm -f "./stored_env" - 02: unset "TOKEN201703172323_NAME" + 02: unset "TOKEN201703181458_NAME" 03: export | awk 'BEGIN {FS="="} $0 !~ /^(OLDPWD|_)/ {print $1"="}' > "./stored_env" STDIN: - 01: export -p TOKEN201703172323_NAME + 01: export -p TOKEN201703181458_NAME 02: ./display_env STDOUT:  FAILURE expected_to_not match_each_regex_of_file `./stored_env` - SUCCESS expected_to_not match_regex `TOKEN201703172323_NAME` + SUCCESS expected_to_not match_regex `TOKEN201703181458_NAME`  01: export TERM_PROGRAM=iTerm.app 02: export TERM=screen-256color 03: export SHELL=/bin/zsh 04: export HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 05: export TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 06: export Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 06: export Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 07: export TERM_PROGRAM_VERSION=3.0.10 - 08: export TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 08: export TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 09: export ZSH=/Users/ariard/.oh-my-zsh 10: export USER=ariard - 11: export SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 11: export SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 12: export __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 13: export PAGER=less - 14: export TMUX=/private/tmp/tmux-18965/default,83855,1 + 14: export TMUX=/private/tmp/tmux-18965/default,63199,0 15: export HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 16: export LSCOLORS=Gxfxcxdxbxegedabagacad 17: export PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 18: export MAIL=ariard@student.42.fr - 19: export PWD=/Users/ariard/42shelltest-tmp/tmp + 19: export PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 20: export LANG=en_US.UTF-8 21: export ITERM_PROFILE=Default 22: export XPC_FLAGS=0x0 - 23: export TMUX_PANE=%8 + 23: export TMUX_PANE=%2 24: export XPC_SERVICE_NAME=0 25: export SHLVL=4 26: export HOME=/Users/ariard 27: export COLORFGBG=7;0 - 28: export ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 28: export ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 29: export LOGNAME=ariard 30: export LESS=-R 31: export LC_CTYPE=en_US.UTF-8 32: export TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 33: export OLDPWD=/Users/ariard/42shelltest-tmp - 34: export _=/Users/ariard/Projects/42sh/42sh + 33: export OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 34: export _=../../42sh 35: export ?=0 36: ------------------------------ 37: TERM_PROGRAM=iTerm.app @@ -627,35 +516,35 @@ 39: SHELL=/bin/zsh 40: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 41: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 42: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 42: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 43: TERM_PROGRAM_VERSION=3.0.10 - 44: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 44: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 45: ZSH=/Users/ariard/.oh-my-zsh 46: USER=ariard - 47: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 47: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 48: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 49: PAGER=less - 50: TMUX=/private/tmp/tmux-18965/default,83855,1 + 50: TMUX=/private/tmp/tmux-18965/default,63199,0 51: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 52: LSCOLORS=Gxfxcxdxbxegedabagacad 53: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 54: MAIL=ariard@student.42.fr - 55: PWD=/Users/ariard/42shelltest-tmp/tmp + 55: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 56: LANG=en_US.UTF-8 57: ITERM_PROFILE=Default 58: XPC_FLAGS=0x0 - 59: TMUX_PANE=%8 + 59: TMUX_PANE=%2 60: XPC_SERVICE_NAME=0 61: SHLVL=4 62: HOME=/Users/ariard 63: COLORFGBG=7;0 - 64: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 64: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 65: LOGNAME=ariard 66: LESS=-R 67: LC_CTYPE=en_US.UTF-8 68: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 69: OLDPWD=/Users/ariard/42shelltest-tmp - 70: _=/Users/ariard/Projects/42sh/42sh + 69: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 70: _=../../42sh 71: ?=0 72: ------------------------------ 73: TOTAL ENVIRONMENT VARIABLES: 35 @@ -672,58 +561,58 @@  The purpose of this test is to check that using the builtin `export` with option `-n` results in a removed environment variable. Before test: - 01: export TOKEN201703172323_NAME=TOKEN201703172323_VALUE + 01: export TOKEN201703181458_NAME=TOKEN201703181458_VALUE STDIN: - 01: export -n TOKEN201703172323_NAME + 01: export -n TOKEN201703181458_NAME 02: export 03: ./display_env STDOUT: - FAILURE expected_to_not match_regex `TOKEN201703172323_NAME` + FAILURE expected_to_not match_regex `TOKEN201703181458_NAME`  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp - 06: TOKEN201703172323_NAME= - 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render - 09: TERM_PROGRAM_VERSION=3.0.10 - 10: OLDPWD=/Users/ariard/42shelltest-tmp - 11: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 - 12: ZSH=/Users/ariard/.oh-my-zsh - 13: USER=ariard - 14: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners - 15: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 16: PAGER=less - 17: TMUX=/private/tmp/tmux-18965/default,83855,1 - 18: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches - 19: LSCOLORS=Gxfxcxdxbxegedabagacad - 20: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin - 21: MAIL=ariard@student.42.fr - 22: PWD=/Users/ariard/42shelltest-tmp/tmp - 23: LANG=en_US.UTF-8 - 24: ITERM_PROFILE=Default - 25: XPC_FLAGS=0x0 - 26: TMUX_PANE=%8 - 27: XPC_SERVICE_NAME=0 - 28: SHLVL=4 - 29: HOME=/Users/ariard - 30: COLORFGBG=7;0 - 31: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 - 32: LOGNAME=ariard - 33: LESS=-R + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 10: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 + 11: ZSH=/Users/ariard/.oh-my-zsh + 12: USER=ariard + 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners + 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 15: PAGER=less + 16: TMUX=/private/tmp/tmux-18965/default,63199,0 + 17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 18: LSCOLORS=Gxfxcxdxbxegedabagacad + 19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 20: MAIL=ariard@student.42.fr + 21: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp + 22: LANG=en_US.UTF-8 + 23: ITERM_PROFILE=Default + 24: XPC_FLAGS=0x0 + 25: TMUX_PANE=%2 + 26: XPC_SERVICE_NAME=0 + 27: SHLVL=4 + 28: HOME=/Users/ariard + 29: COLORFGBG=7;0 + 30: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 + 31: LOGNAME=ariard + 32: LESS=-R + 33: TOKEN201703181458_NAME= 34: LC_CTYPE=en_US.UTF-8 35: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 36: _=/Users/ariard/Projects/42sh/42sh + 36: _=../../42sh 37: ?=0 38: ------------------------------ 39: TOTAL ENVIRONMENT VARIABLES: 36 STDERR:  FAILURE expected_to be_empty - 01: /Users/ariard/Projects/42sh/42sh: invalid option -n + 01: ../../42sh: invalid option -n ---------------------------------------------------------------- @@ -763,6 +652,99 @@ ---------------------------------------------------------------- +42sh/escaping/mixed/globbing/bracket-expansion/001-it-does-not-expand-brackets (FAILED) + + Description: + The purpose of this test is to check that escaping brackets does not result in an expansion process. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout \[abc] [abc\] \[abc\] + + STDOUT: + FAILURE expected_to match_regex `^[[]abc]@[[]abc]@[[]abc]@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/escaping/mixed/globbing/bracket-expansion/002-escaped-inversion-mark (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with an inversion mark `!` or `^` as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' '!' '^' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [\!abc] + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [\^abc] + + STDOUT: + FAILURE expected_to match_regex `!@` + FAILURE expected_to match_regex `[\^]@` + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + SUCCESS expected_to_not match_regex `d@` + SUCCESS expected_to_not match_regex `e@` + SUCCESS expected_to_not match_regex `f@` + WARNING might match_regex `^!@a@b@c@$` + WARNING might match_regex `^[\^]@a@b@c@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/escaping/mixed/globbing/bracket-expansion/003-it-takes-escaped-bracket-as-pattern-character (FAILED) + + Description: + The purpose of this test is to check that a closing bracket ']' may be escaped in a backet expansion pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' ']' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [abc\]def] + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [abc\\\]def] + 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [abc\\\\\]def] + 04: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [abc\\\\\\\]def] + + STDOUT: + FAILURE expected_to match_regex `a@` 4 times + FAILURE expected_to match_regex `b@` 4 times + FAILURE expected_to match_regex `c@` 4 times + FAILURE expected_to match_regex `]@` 4 times + FAILURE expected_to match_regex `d@` 4 times + FAILURE expected_to match_regex `e@` 4 times + FAILURE expected_to match_regex `f@` 4 times + SUCCESS expected_to_not match_regex `def` + WARNING might match_regex `^]@a@b@c@d@e@f@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + 42sh/globbing/brace-expansion/ascii-range/001-simple-ascending-1 (FAILED) Description: @@ -787,11 +769,11 @@  The purpose of this test is to check that the brace expansion does work with an ASCII range in ascending order. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{a..e}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout TOKEN201703181458{a..e}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323aTOKEN201703172323@TOKEN201703172323bTOKEN201703172323@TOKEN201703172323cTOKEN201703172323@TOKEN201703172323dTOKEN201703172323@TOKEN201703172323eTOKEN201703172323@$` - 01: TOKEN201703172323{a..e}TOKEN201703172323@ + FAILURE expected_to match_regex `^TOKEN201703181458aTOKEN201703181458@TOKEN201703181458bTOKEN201703181458@TOKEN201703181458cTOKEN201703181458@TOKEN201703181458dTOKEN201703181458@TOKEN201703181458eTOKEN201703181458@$` + 01: TOKEN201703181458{a..e}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -841,11 +823,11 @@  The purpose of this test is to check that the brace expansion does work with an ASCII range in descending order. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{E..A}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout TOKEN201703181458{E..A}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323ETOKEN201703172323@TOKEN201703172323DTOKEN201703172323@TOKEN201703172323CTOKEN201703172323@TOKEN201703172323BTOKEN201703172323@TOKEN201703172323ATOKEN201703172323@$` - 01: TOKEN201703172323{E..A}TOKEN201703172323@ + FAILURE expected_to match_regex `^TOKEN201703181458ETOKEN201703181458@TOKEN201703181458DTOKEN201703181458@TOKEN201703181458CTOKEN201703181458@TOKEN201703181458BTOKEN201703181458@TOKEN201703181458ATOKEN201703181458@$` + 01: TOKEN201703181458{E..A}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -859,11 +841,11 @@  The purpose of this test is to check that the brace expansion does work with an ASCII range in descending order. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{e..a} + 01: ./write_all_arguments_on_stdout TOKEN201703181458{e..a} STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323e@TOKEN201703172323d@TOKEN201703172323c@TOKEN201703172323b@TOKEN201703172323a@$` - 01: TOKEN201703172323{e..a}@ + FAILURE expected_to match_regex `^TOKEN201703181458e@TOKEN201703181458d@TOKEN201703181458c@TOKEN201703181458b@TOKEN201703181458a@$` + 01: TOKEN201703181458{e..a}@ STDERR:  SUCCESS expected_to be_empty @@ -913,11 +895,11 @@  The purpose of this test is to check that brace expansion may be performed with multiple brace patterns. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{a..b}abc{Z..X}def{s..s} + 01: ./write_all_arguments_on_stdout TOKEN201703181458{a..b}abc{Z..X}def{s..s} STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323aabcZdefs@TOKEN201703172323aabcYdefs@TOKEN201703172323aabcXdefs@TOKEN201703172323babcZdefs@TOKEN201703172323babcYdefs@TOKEN201703172323babcXdefs@$` - 01: TOKEN201703172323{a..b}abc{Z..X}def{s..s}@ + FAILURE expected_to match_regex `^TOKEN201703181458aabcZdefs@TOKEN201703181458aabcYdefs@TOKEN201703181458aabcXdefs@TOKEN201703181458babcZdefs@TOKEN201703181458babcYdefs@TOKEN201703181458babcXdefs@$` + 01: TOKEN201703181458{a..b}abc{Z..X}def{s..s}@ STDERR:  SUCCESS expected_to be_empty @@ -967,11 +949,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{1..5}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout TOKEN201703181458{1..5}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^TOKEN2017031723231TOKEN201703172323@TOKEN2017031723232TOKEN201703172323@TOKEN2017031723233TOKEN201703172323@TOKEN2017031723234TOKEN201703172323@TOKEN2017031723235TOKEN201703172323@$` - 01: TOKEN201703172323{1..5}TOKEN201703172323@ + FAILURE expected_to match_regex `^TOKEN2017031814581TOKEN201703181458@TOKEN2017031814582TOKEN201703181458@TOKEN2017031814583TOKEN201703181458@TOKEN2017031814584TOKEN201703181458@TOKEN2017031814585TOKEN201703181458@$` + 01: TOKEN201703181458{1..5}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -985,11 +967,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{1..+5} + 01: ./write_all_arguments_on_stdout TOKEN201703181458{1..+5} STDOUT: - FAILURE expected_to match_regex `^TOKEN2017031723231@TOKEN2017031723232@TOKEN2017031723233@TOKEN2017031723234@TOKEN2017031723235@$` - 01: TOKEN201703172323{1..+5}@ + FAILURE expected_to match_regex `^TOKEN2017031814581@TOKEN2017031814582@TOKEN2017031814583@TOKEN2017031814584@TOKEN2017031814585@$` + 01: TOKEN201703181458{1..+5}@ STDERR:  SUCCESS expected_to be_empty @@ -1003,11 +985,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. STDIN: - 01: ./write_all_arguments_on_stdout {-5..0}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout {-5..0}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^-5TOKEN201703172323@-4TOKEN201703172323@-3TOKEN201703172323@-2TOKEN201703172323@-1TOKEN201703172323@0TOKEN201703172323@$` - 01: {-5..0}TOKEN201703172323@ + FAILURE expected_to match_regex `^-5TOKEN201703181458@-4TOKEN201703181458@-3TOKEN201703181458@-2TOKEN201703181458@-1TOKEN201703181458@0TOKEN201703181458@$` + 01: {-5..0}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -1021,11 +1003,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in ascending order. STDIN: - 01: ./write_all_arguments_on_stdout {-100..-98}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout {-100..-98}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^-100TOKEN201703172323@-99TOKEN201703172323@-98TOKEN201703172323@$` - 01: {-100..-98}TOKEN201703172323@ + FAILURE expected_to match_regex `^-100TOKEN201703181458@-99TOKEN201703181458@-98TOKEN201703181458@$` + 01: {-100..-98}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -1057,11 +1039,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{5..1}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout TOKEN201703181458{5..1}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^TOKEN2017031723235TOKEN201703172323@TOKEN2017031723234TOKEN201703172323@TOKEN2017031723233TOKEN201703172323@TOKEN2017031723232TOKEN201703172323@TOKEN2017031723231TOKEN201703172323@$` - 01: TOKEN201703172323{5..1}TOKEN201703172323@ + FAILURE expected_to match_regex `^TOKEN2017031814585TOKEN201703181458@TOKEN2017031814584TOKEN201703181458@TOKEN2017031814583TOKEN201703181458@TOKEN2017031814582TOKEN201703181458@TOKEN2017031814581TOKEN201703181458@$` + 01: TOKEN201703181458{5..1}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -1075,11 +1057,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{5..+1} + 01: ./write_all_arguments_on_stdout TOKEN201703181458{5..+1} STDOUT: - FAILURE expected_to match_regex `^TOKEN2017031723235@TOKEN2017031723234@TOKEN2017031723233@TOKEN2017031723232@TOKEN2017031723231@$` - 01: TOKEN201703172323{5..+1}@ + FAILURE expected_to match_regex `^TOKEN2017031814585@TOKEN2017031814584@TOKEN2017031814583@TOKEN2017031814582@TOKEN2017031814581@$` + 01: TOKEN201703181458{5..+1}@ STDERR:  SUCCESS expected_to be_empty @@ -1093,11 +1075,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. STDIN: - 01: ./write_all_arguments_on_stdout {0..-5}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout {0..-5}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^0TOKEN201703172323@-1TOKEN201703172323@-2TOKEN201703172323@-3TOKEN201703172323@-4TOKEN201703172323@-5TOKEN201703172323@$` - 01: {0..-5}TOKEN201703172323@ + FAILURE expected_to match_regex `^0TOKEN201703181458@-1TOKEN201703181458@-2TOKEN201703181458@-3TOKEN201703181458@-4TOKEN201703181458@-5TOKEN201703181458@$` + 01: {0..-5}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -1111,11 +1093,11 @@  The purpose of this test is to check that the brace expansion does work with a numeric range in descending order. STDIN: - 01: ./write_all_arguments_on_stdout {-98..-100}TOKEN201703172323 + 01: ./write_all_arguments_on_stdout {-98..-100}TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^-98TOKEN201703172323@-99TOKEN201703172323@-100TOKEN201703172323@$` - 01: {-98..-100}TOKEN201703172323@ + FAILURE expected_to match_regex `^-98TOKEN201703181458@-99TOKEN201703181458@-100TOKEN201703181458@$` + 01: {-98..-100}TOKEN201703181458@ STDERR:  SUCCESS expected_to be_empty @@ -1183,11 +1165,11 @@  The purpose of this test is to check that brace expansion may be performed with multiple brace patterns. STDIN: - 01: ./write_all_arguments_on_stdout TOKEN201703172323{1..2}abc{-50..-53}def{0..0} + 01: ./write_all_arguments_on_stdout TOKEN201703181458{1..2}abc{-50..-53}def{0..0} STDOUT: - FAILURE expected_to match_regex `^TOKEN2017031723231abc-50def0@TOKEN2017031723231abc-51def0@TOKEN2017031723231abc-52def0@TOKEN2017031723231abc-53def0@TOKEN2017031723232abc-50def0@TOKEN2017031723232abc-51def0@TOKEN2017031723232abc-52def0@TOKEN2017031723232abc-53def0@$` - 01: TOKEN201703172323{1..2}abc{-50..-53}def{0..0}@ + FAILURE expected_to match_regex `^TOKEN2017031814581abc-50def0@TOKEN2017031814581abc-51def0@TOKEN2017031814581abc-52def0@TOKEN2017031814581abc-53def0@TOKEN2017031814582abc-50def0@TOKEN2017031814582abc-51def0@TOKEN2017031814582abc-52def0@TOKEN2017031814582abc-53def0@$` + 01: TOKEN201703181458{1..2}abc{-50..-53}def{0..0}@ STDERR:  SUCCESS expected_to be_empty @@ -1213,6 +1195,40 @@ ---------------------------------------------------------------- +42sh/globbing/bracket-expansion/multi/001-range-and-char (FAILED) + + Description: + The purpose of this test is to check that brackets expansion works with a range and 2 characters as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '1' '2' '3' 'a' 'b' 'z' 'C' '-' '[a-z-2]' 'a-z-2' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [a-z-2] + + STDOUT: + FAILURE expected_to match_regex `-@` + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `z@` + SUCCESS expected_to_not match_regex `1@` + SUCCESS expected_to_not match_regex `3@` + SUCCESS expected_to_not match_regex `C@` + SUCCESS expected_to_not match_regex `[[]a-z-2]@` + SUCCESS expected_to_not match_regex `a-z-2@` + WARNING might match_regex `^-@2@a@b@z@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + 42sh/globbing/bracket-expansion/multi/002-reverse-range-and-chars (FAILED) Description: @@ -1225,25 +1241,25 @@ 04: touch 'a4' 'a3' 'a2' 'a42' 'a[42]' 'z4' 'z3' 'z2' 'z42' 'z[42]' '42' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!a-y][42] - 02: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^a-y][42] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!a-y][42] + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^a-y][42] STDOUT: - SUCCESS expected_to match_regex `42@` - SUCCESS expected_to match_regex `z4@` - SUCCESS expected_to match_regex `z2@` + FAILURE expected_to match_regex `42@` + FAILURE expected_to match_regex `z4@` + FAILURE expected_to match_regex `z2@`  SUCCESS expected_to_not match_regex `z3@`  SUCCESS expected_to_not match_regex `z42@`  SUCCESS expected_to_not match_regex `z[[]42]@`  SUCCESS expected_to_not match_regex `a3@`  SUCCESS expected_to_not match_regex `a42@`  SUCCESS expected_to_not match_regex `a[[]42]@` - SUCCESS might match_regex `^42@z2@z4@$` - 01: 42@z2@z4@ + WARNING might match_regex `^42@z2@z4@$` + (no output) STDERR:  FAILURE expected_to be_empty - 01: syntax error near unexpected token `!' + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory ---------------------------------------------------------------- @@ -1259,23 +1275,23 @@ 04: touch '][' 'a[' '1[' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!]az][[] - 02: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^]az][[] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!]az][[] + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^]az][[] STDOUT:  FAILURE expected_to match_regex `1[[]@`  SUCCESS expected_to_not match_regex `][[]@`  SUCCESS expected_to_not match_regex `a[[]@`  WARNING might match_regex `^1[[]@$` - 01: [^]az][[]@ + (no output) STDERR:  FAILURE expected_to be_empty - 01: syntax error near unexpected token `!' + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory ---------------------------------------------------------------- -42sh/globbing/bracket-expansion/multi/004-simple-bracket+char+range (WARNING) +42sh/globbing/bracket-expansion/multi/004-simple-bracket+char+range (FAILED) Description:  The purpose of this test is to control if 2 patterns splited by a minus characters can be match. @@ -1287,13 +1303,13 @@ 04: touch 'a-0' 'a-1' 'a-2' 'b-0' 'b-1' 'b-2' 'Z-0' 'Z-1' 'Z-2' 'a1' 'Z9' 'D4' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [aZ]-[1-9] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [aZ]-[1-9] STDOUT: - SUCCESS expected_to match_regex `a-1@` - SUCCESS expected_to match_regex `a-2@` - SUCCESS expected_to match_regex `Z-1@` - SUCCESS expected_to match_regex `Z-2@` + FAILURE expected_to match_regex `a-1@` + FAILURE expected_to match_regex `a-2@` + FAILURE expected_to match_regex `Z-1@` + FAILURE expected_to match_regex `Z-2@`  SUCCESS expected_to_not match_regex `a-0@`  SUCCESS expected_to_not match_regex `b-0@`  SUCCESS expected_to_not match_regex `b-1@` @@ -1302,11 +1318,11 @@  SUCCESS expected_to_not match_regex `Z9@`  SUCCESS expected_to_not match_regex `D4@`  WARNING might match_regex `^Z-1@Z-2@a-1@a-2@$` - 01: a-1@a-2@Z-1@Z-2@ + (no output) STDERR: - SUCCESS expected_to be_empty - (no output) + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory ---------------------------------------------------------------- @@ -1322,20 +1338,20 @@ 04: touch 'a' '1' 'Z' 'd' 'e' 'f' 'def' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!a1Z] - 02: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^a1Z] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!a1Z] + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^a1Z] STDOUT: - SUCCESS expected_to match_regex `d@` - SUCCESS expected_to match_regex `e@` - SUCCESS expected_to match_regex `f@` + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@`  SUCCESS expected_to_not match_regex `def@` - SUCCESS might match_regex `^d@e@f@$` - 01: d@e@f@ + WARNING might match_regex `^d@e@f@$` + (no output) STDERR:  FAILURE expected_to be_empty - 01: syntax error near unexpected token `!' + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory ---------------------------------------------------------------- @@ -1351,20 +1367,81 @@ 04: touch 'a' 'b' 'c' 'z' '1' '2' '3' '42' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!a-z] - 02: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^a-z] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [!a-z] + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [^a-z] STDOUT: - SUCCESS expected_to match_regex `1@` - SUCCESS expected_to match_regex `2@` - SUCCESS expected_to match_regex `3@` + FAILURE expected_to match_regex `1@` + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `3@`  SUCCESS expected_to_not match_regex `42@` - SUCCESS might match_regex `^1@2@3@$` - 01: 1@2@3@ + WARNING might match_regex `^1@2@3@$` + (no output) STDERR:  FAILURE expected_to be_empty - 01: syntax error near unexpected token `!' + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/range-pattern/001-alpha-range (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with the following pattern `[a-z]`. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'f' 'z' 'A' '1' '[a-z]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [a-z] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `z@` + SUCCESS expected_to_not match_regex `A@` + SUCCESS expected_to_not match_regex `1@` + SUCCESS expected_to_not match_regex `[[]a-z]@` + WARNING might match_regex `^a@f@z@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/range-pattern/002-numeric-range (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with the following pattern `[0-9]`. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '4' '2' '1' '9' 'a' 'C' '[0-9]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [0-9] + + STDOUT: + FAILURE expected_to match_regex `1@` + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `4@` + FAILURE expected_to match_regex `9@` + SUCCESS expected_to_not match_regex `a@` + SUCCESS expected_to_not match_regex `C@` + SUCCESS expected_to_not match_regex `[[]0-9]@` + WARNING might match_regex `^1@2@4@9@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory ---------------------------------------------------------------- @@ -1383,27 +1460,27 @@ 04: touch '2' 'a' 'B' 'c' 'Z' '[' ']' '[]-z]' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout []-z] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout []-z] STDOUT:  FAILURE expected_to match_regex `a@`  FAILURE expected_to match_regex `c@` - SUCCESS expected_to match_regex `]@` + FAILURE expected_to match_regex `]@`  SUCCESS expected_to_not match_regex `2@`  SUCCESS expected_to_not match_regex `B@`  SUCCESS expected_to_not match_regex `Z@`  SUCCESS expected_to_not match_regex `[[]@` - FAILURE expected_to_not match_regex `[[]]-z]@` + SUCCESS expected_to_not match_regex `[[]]-z]@`  WARNING might match_regex `^]@a@c@$` - 01: []-z]@ + (no output) STDERR: - SUCCESS expected_to be_empty - (no output) + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory ---------------------------------------------------------------- -42sh/globbing/bracket-expansion/range-pattern/004-ascii-range-2 (WARNING) +42sh/globbing/bracket-expansion/range-pattern/004-ascii-range-2 (FAILED) Description:  The purpose of this test is to check that the brackets expansion works with the following pattern `[1-z]`. @@ -1415,26 +1492,86 @@ 04: touch '2' 'a' 'B' 'c' 'Z' ']' '[' '[1-z]' '1-z' '-' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [1-z] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [1-z] STDOUT: - SUCCESS expected_to match_regex `2@` - SUCCESS expected_to match_regex `a@` - SUCCESS expected_to match_regex `B@` - SUCCESS expected_to match_regex `c@` - SUCCESS expected_to match_regex `Z@` - SUCCESS expected_to match_regex `]@` - SUCCESS expected_to match_regex `[[]@` + FAILURE expected_to match_regex `2@` + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `B@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `Z@` + FAILURE expected_to match_regex `]@` + FAILURE expected_to match_regex `[[]@`  SUCCESS expected_to_not match_regex `-@`  SUCCESS expected_to_not match_regex `1-z@`  SUCCESS expected_to_not match_regex `[[]1-z]@`  WARNING might match_regex `^2@B@Z@[[]@]@a@c@$` - 01: 2@[@]@a@B@c@Z@ + (no output) STDERR: - SUCCESS expected_to be_empty + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/simple-pattern/001-simple-list (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with a simple list of characters as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' '[bca]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [bca] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + SUCCESS expected_to_not match_regex `d@` + SUCCESS expected_to_not match_regex `e@` + SUCCESS expected_to_not match_regex `f@` + SUCCESS expected_to_not match_regex `[[]bca]@` + WARNING might match_regex `^a@b@c@$`  (no output) + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/simple-pattern/002-multi-bracket (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with multiple brackets patterns. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch "TOKEN201703181458abcd" "TOKEN201703181458abc" "TOKEN201703181458abdc" "TOKEN201703181458b" "TOKEN201703181458" "TOKEN201703181458\[a]b\[c]\[d]" + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout TOKEN201703181458[a]b[c][d] + + STDOUT: + FAILURE expected_to match_regex `^TOKEN201703181458abcd@$` + SUCCESS expected_to_not match_regex `TOKEN201703181458abc@` + SUCCESS expected_to_not match_regex `TOKEN201703181458abdc@` + SUCCESS expected_to_not match_regex `TOKEN201703181458b@` + SUCCESS expected_to_not match_regex `TOKEN201703181458@` + SUCCESS expected_to_not match_regex `TOKEN201703181458[[]a]b[[]c][[]d]@` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + ---------------------------------------------------------------- 42sh/globbing/bracket-expansion/simple-pattern/003-brackets-as-pattern (FAILED) @@ -1449,21 +1586,85 @@ 04: touch '[' ']' 'a' 'Z' '[][]' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout [][] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [][] STDOUT:  FAILURE expected_to match_regex `[[]@` - SUCCESS expected_to match_regex `]@` + FAILURE expected_to match_regex `]@`  SUCCESS expected_to_not match_regex `a@`  SUCCESS expected_to_not match_regex `Z@` - FAILURE expected_to_not match_regex `[[]][[]]@` + SUCCESS expected_to_not match_regex `[[]][[]]@`  WARNING might match_regex `^[[]@]@$` - 01: [][]@ + (no output) STDERR: - SUCCESS expected_to be_empty + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/simple-pattern/004-multi-bracket-multi-char (FAILED) + + Description: + The purpose of this test is to match a file name which contain a bracket as first character. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 21 23 24 25 26 27 28 29 ']' '[' '[12][34]' '1234' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [12][34] + + STDOUT: + FAILURE expected_to match_regex `13@` + FAILURE expected_to match_regex `14@` + FAILURE expected_to match_regex `23@` + FAILURE expected_to match_regex `24@` + SUCCESS expected_to_not match_regex `0[0-9]@` + SUCCESS expected_to_not match_regex `1[0-2]@` + SUCCESS expected_to_not match_regex `1[5-9]@` + SUCCESS expected_to_not match_regex `2[0-2]@` + SUCCESS expected_to_not match_regex `2[5-9]@` + SUCCESS expected_to_not match_regex `[[]@` + SUCCESS expected_to_not match_regex `]@` + SUCCESS expected_to_not match_regex `[[]12][[]34]@` + SUCCESS expected_to_not match_regex `1234@` + WARNING might match_regex `^13@14@23@24@$`  (no output) + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/single-char-pattern/001-single-char (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with a single character as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' '[a]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [a] + + STDOUT: + FAILURE expected_to match_regex `a@` + SUCCESS expected_to_not match_regex `b@` + SUCCESS expected_to_not match_regex `[[]a]@` + WARNING might match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + ---------------------------------------------------------------- 42sh/globbing/bracket-expansion/single-char-pattern/002-closing-bracket-char (FAILED) @@ -1478,18 +1679,44 @@ 04: touch ']' '[]]' STDIN: - 01: /Users/ariard/42shelltest-tmp/tmp/write_all_arguments_on_stdout []] + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout []] STDOUT: - SUCCESS expected_to match_regex `]@` - FAILURE expected_to_not match_regex `[[]]]@` + FAILURE expected_to match_regex `]@` + SUCCESS expected_to_not match_regex `[[]]]@`  WARNING might match_regex `^]@$` - 01: []]@ + (no output) STDERR: - SUCCESS expected_to be_empty + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/globbing/bracket-expansion/single-char-pattern/003-opening-bracket-char (FAILED) + + Description: + The purpose of this test is to check that the brackets expansion works with an opening bracket `[` as pattern. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch '[' '[[]' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [[] + + STDOUT: + FAILURE expected_to match_regex `[[]@` + SUCCESS expected_to_not match_regex `[[][[]]@` + WARNING might match_regex `^[[]@$`  (no output) + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + ---------------------------------------------------------------- 42sh/local-variable/002-declare-and-expand-2 (FAILED) @@ -1498,8 +1725,8 @@  The purpose of this test is to check that an empty variable is not expanded as an empty string and results in any new argument in the command line. STDIN: - 01: TOKEN201703172323_NAME= - 02: ./write_on_stdout_and_stderr $TOKEN201703172323_NAME $TOKEN201703172323_NAME + 01: TOKEN201703181458_NAME= + 02: ./write_on_stdout_and_stderr $TOKEN201703181458_NAME $TOKEN201703181458_NAME STDOUT:  FAILURE expected_to match_regex `write on stdout` @@ -1517,13 +1744,13 @@  The purpose of this test is to check that an unknown variable is not expanded as an empty string and results in any new argument in the command line. Before test: - 01: unset "TOKEN201703172323_UNKNOWN" + 01: unset "TOKEN201703181458_UNKNOWN" STDIN: - 01: ./write_on_stdout $TOKEN201703172323_UNKNOWN TOKEN201703172323_DISPLAYED + 01: ./write_on_stdout $TOKEN201703181458_UNKNOWN TOKEN201703181458_DISPLAYED STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323_DISPLAYED` + FAILURE expected_to match_regex `TOKEN201703181458_DISPLAYED`  01: write on stdout STDERR: @@ -1538,51 +1765,51 @@  The purpose of this test is initialize a local variable named as an environment variable and check if it's update the existing environment variable. Before test: - 01: export "TOKEN201703172323_NAME=TOKEN201703172323_VALUE_OLD" + 01: export "TOKEN201703181458_NAME=TOKEN201703181458_VALUE_OLD" STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_VALUE_NEW + 01: TOKEN201703181458_NAME=TOKEN201703181458_VALUE_NEW 02: ./display_env STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE_NEW$` - FAILURE expected_to_not match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE_OLD$` + FAILURE expected_to match_regex `^TOKEN201703181458_NAME=TOKEN201703181458_VALUE_NEW$` + FAILURE expected_to_not match_regex `^TOKEN201703181458_NAME=TOKEN201703181458_VALUE_OLD$`  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp - 06: TOKEN201703172323_NAME=TOKEN201703172323_VALUE_OLD - 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render - 09: TERM_PROGRAM_VERSION=3.0.10 - 10: OLDPWD=/Users/ariard/42shelltest-tmp - 11: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 - 12: ZSH=/Users/ariard/.oh-my-zsh - 13: USER=ariard - 14: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners - 15: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 16: PAGER=less - 17: TMUX=/private/tmp/tmux-18965/default,83855,1 - 18: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches - 19: LSCOLORS=Gxfxcxdxbxegedabagacad - 20: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin - 21: MAIL=ariard@student.42.fr - 22: PWD=/Users/ariard/42shelltest-tmp/tmp - 23: LANG=en_US.UTF-8 - 24: ITERM_PROFILE=Default - 25: XPC_FLAGS=0x0 - 26: TMUX_PANE=%8 - 27: XPC_SERVICE_NAME=0 - 28: SHLVL=4 - 29: HOME=/Users/ariard - 30: COLORFGBG=7;0 - 31: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 - 32: LOGNAME=ariard - 33: LESS=-R + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 10: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 + 11: ZSH=/Users/ariard/.oh-my-zsh + 12: USER=ariard + 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners + 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 15: PAGER=less + 16: TMUX=/private/tmp/tmux-18965/default,63199,0 + 17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 18: LSCOLORS=Gxfxcxdxbxegedabagacad + 19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 20: MAIL=ariard@student.42.fr + 21: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp + 22: LANG=en_US.UTF-8 + 23: ITERM_PROFILE=Default + 24: XPC_FLAGS=0x0 + 25: TMUX_PANE=%2 + 26: XPC_SERVICE_NAME=0 + 27: SHLVL=4 + 28: HOME=/Users/ariard + 29: COLORFGBG=7;0 + 30: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 + 31: LOGNAME=ariard + 32: LESS=-R + 33: TOKEN201703181458_NAME=TOKEN201703181458_VALUE_OLD 34: LC_CTYPE=en_US.UTF-8 35: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 36: _=/Users/ariard/Projects/42sh/42sh + 36: _=../../42sh 37: ?=0 38: ------------------------------ 39: TOTAL ENVIRONMENT VARIABLES: 36 @@ -1599,51 +1826,51 @@  The purpose of this test is initialize a local variable named as an environment variable and check if it's update the existing environment variable. Before test: - 01: export "TOKEN201703172323_NAME=TOKEN201703172323_VALUE" + 01: export "TOKEN201703181458_NAME=TOKEN201703181458_VALUE" STDIN: - 01: TOKEN201703172323_NAME= + 01: TOKEN201703181458_NAME= 02: ./display_env STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=$` - FAILURE expected_to_not match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE$` + FAILURE expected_to match_regex `^TOKEN201703181458_NAME=$` + FAILURE expected_to_not match_regex `^TOKEN201703181458_NAME=TOKEN201703181458_VALUE$`  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp - 06: TOKEN201703172323_NAME=TOKEN201703172323_VALUE - 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render - 09: TERM_PROGRAM_VERSION=3.0.10 - 10: OLDPWD=/Users/ariard/42shelltest-tmp - 11: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 - 12: ZSH=/Users/ariard/.oh-my-zsh - 13: USER=ariard - 14: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners - 15: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 - 16: PAGER=less - 17: TMUX=/private/tmp/tmux-18965/default,83855,1 - 18: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches - 19: LSCOLORS=Gxfxcxdxbxegedabagacad - 20: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin - 21: MAIL=ariard@student.42.fr - 22: PWD=/Users/ariard/42shelltest-tmp/tmp - 23: LANG=en_US.UTF-8 - 24: ITERM_PROFILE=Default - 25: XPC_FLAGS=0x0 - 26: TMUX_PANE=%8 - 27: XPC_SERVICE_NAME=0 - 28: SHLVL=4 - 29: HOME=/Users/ariard - 30: COLORFGBG=7;0 - 31: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 - 32: LOGNAME=ariard - 33: LESS=-R + 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render + 08: TERM_PROGRAM_VERSION=3.0.10 + 09: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 10: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 + 11: ZSH=/Users/ariard/.oh-my-zsh + 12: USER=ariard + 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners + 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 + 15: PAGER=less + 16: TMUX=/private/tmp/tmux-18965/default,63199,0 + 17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches + 18: LSCOLORS=Gxfxcxdxbxegedabagacad + 19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin + 20: MAIL=ariard@student.42.fr + 21: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp + 22: LANG=en_US.UTF-8 + 23: ITERM_PROFILE=Default + 24: XPC_FLAGS=0x0 + 25: TMUX_PANE=%2 + 26: XPC_SERVICE_NAME=0 + 27: SHLVL=4 + 28: HOME=/Users/ariard + 29: COLORFGBG=7;0 + 30: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 + 31: LOGNAME=ariard + 32: LESS=-R + 33: TOKEN201703181458_NAME=TOKEN201703181458_VALUE 34: LC_CTYPE=en_US.UTF-8 35: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 36: _=/Users/ariard/Projects/42sh/42sh + 36: _=../../42sh 37: ?=0 38: ------------------------------ 39: TOTAL ENVIRONMENT VARIABLES: 36 @@ -1660,23 +1887,23 @@  The purpose of this test is to check that declaring multiple variables in the same command line does work. STDIN: - 01: TOKEN201703172323_NAME1=TOKEN201703172323_VALUE1 TOKEN201703172323_NAME2=TOKEN201703172323_VALUE2 TOKEN201703172323_NAME3=TOKEN201703172323_VALUE3 - 02: ./write_on_stdout_and_stderr $TOKEN201703172323_NAME1 $TOKEN201703172323_NAME1 - 03: ./write_on_stdout $TOKEN201703172323_NAME2 - 04: ./write_on_stderr $TOKEN201703172323_NAME3 + 01: TOKEN201703181458_NAME1=TOKEN201703181458_VALUE1 TOKEN201703181458_NAME2=TOKEN201703181458_VALUE2 TOKEN201703181458_NAME3=TOKEN201703181458_VALUE3 + 02: ./write_on_stdout_and_stderr $TOKEN201703181458_NAME1 $TOKEN201703181458_NAME1 + 03: ./write_on_stdout $TOKEN201703181458_NAME2 + 04: ./write_on_stderr $TOKEN201703181458_NAME3 STDOUT: - SUCCESS expected_to match_regex `^TOKEN201703172323_VALUE1$` - FAILURE expected_to match_regex `^TOKEN201703172323_VALUE2$` - SUCCESS expected_to_not match_regex `^TOKEN201703172323_VALUE3$` - 01: TOKEN201703172323_VALUE1 + SUCCESS expected_to match_regex `^TOKEN201703181458_VALUE1$` + FAILURE expected_to match_regex `^TOKEN201703181458_VALUE2$` + SUCCESS expected_to_not match_regex `^TOKEN201703181458_VALUE3$` + 01: TOKEN201703181458_VALUE1 02:  STDERR: - SUCCESS expected_to match_regex `^TOKEN201703172323_VALUE1$` - SUCCESS expected_to_not match_regex `^TOKEN201703172323_VALUE2$` - FAILURE expected_to match_regex `^TOKEN201703172323_VALUE3$` - 01: TOKEN201703172323_VALUE1 + SUCCESS expected_to match_regex `^TOKEN201703181458_VALUE1$` + SUCCESS expected_to_not match_regex `^TOKEN201703181458_VALUE2$` + FAILURE expected_to match_regex `^TOKEN201703181458_VALUE3$` + 01: TOKEN201703181458_VALUE1 02:  ---------------------------------------------------------------- @@ -1687,14 +1914,14 @@  The purpose of this test is to check that declaring the same variable several times in the same command line does work and does not result in error. STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_VALUE1 TOKEN201703172323_NAME=TOKEN201703172323_VALUE2 TOKEN201703172323_NAME=TOKEN201703172323_VALUE3 - 02: ./write_on_stdout $TOKEN201703172323_NAME + 01: TOKEN201703181458_NAME=TOKEN201703181458_VALUE1 TOKEN201703181458_NAME=TOKEN201703181458_VALUE2 TOKEN201703181458_NAME=TOKEN201703181458_VALUE3 + 02: ./write_on_stdout $TOKEN201703181458_NAME STDOUT: - FAILURE expected_to_not match_regex `^TOKEN201703172323_VALUE1$` - SUCCESS expected_to_not match_regex `^TOKEN201703172323_VALUE2$` - FAILURE expected_to match_regex `^TOKEN201703172323_VALUE3$` - 01: TOKEN201703172323_VALUE1 + FAILURE expected_to_not match_regex `^TOKEN201703181458_VALUE1$` + SUCCESS expected_to_not match_regex `^TOKEN201703181458_VALUE2$` + FAILURE expected_to match_regex `^TOKEN201703181458_VALUE3$` + 01: TOKEN201703181458_VALUE1 STDERR:  SUCCESS expected_to be_empty @@ -1708,17 +1935,17 @@  The purpose of this test is to check that declaring a variable and specifying a binary does not result in local variable declaration but a modified environment for the command. STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_VALUE ./display_env - 02: ./write_on_stderr $TOKEN201703172323 + 01: TOKEN201703181458_NAME=TOKEN201703181458_VALUE ./display_env + 02: ./write_on_stderr $TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE$` + FAILURE expected_to match_regex `^TOKEN201703181458_NAME=TOKEN201703181458_VALUE$`  (no output) STDERR: - FAILURE expected_to_not match_regex `TOKEN201703172323_VALUE` + FAILURE expected_to_not match_regex `TOKEN201703181458_VALUE`  FAILURE expected_to match_regex `write on stderr` - 01: minishell: command not found: TOKEN201703172323_NAME=TOKEN201703172323_VALUE + 01: minishell: command not found: TOKEN201703181458_NAME=TOKEN201703181458_VALUE 02:  ---------------------------------------------------------------- @@ -1729,11 +1956,11 @@  The purpose of this test is to check that a redirection can be set with a local variable as file name. Before test: - 01: rm -f "TOKEN201703172323_FILENAME" + 01: rm -f "TOKEN201703181458_FILENAME" STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_FILENAME - 02: ./write_on_stdout TOKEN201703172323_VALUE > $TOKEN201703172323_NAME + 01: TOKEN201703181458_NAME=TOKEN201703181458_FILENAME + 02: ./write_on_stdout TOKEN201703181458_VALUE > $TOKEN201703181458_NAME STDOUT:  SUCCESS expected_to be_empty @@ -1744,7 +1971,7 @@  (no output) MISC: - FAILURE expected_to create_file `TOKEN201703172323_FILENAME` matching_regex `^TOKEN201703172323_VALUE$` + FAILURE expected_to create_file `TOKEN201703181458_FILENAME` matching_regex `^TOKEN201703181458_VALUE$`  SUCCESS expected_to exit_with_status `0` ---------------------------------------------------------------- @@ -1755,12 +1982,12 @@  The purpose of this test is to check that a redirection can be set with a local variable as file name. Before test: - 01: rm -f "TOKEN201703172323_FILENAME" + 01: rm -f "TOKEN201703181458_FILENAME" STDIN: - 01: TOKEN201703172323_NAME=TOKEN201703172323_FILENAME - 02: ./write_on_stdout TOKEN201703172323_VALUE1 >> $TOKEN201703172323_NAME - 03: ./write_on_stdout TOKEN201703172323_VALUE2 >> $TOKEN201703172323_NAME + 01: TOKEN201703181458_NAME=TOKEN201703181458_FILENAME + 02: ./write_on_stdout TOKEN201703181458_VALUE1 >> $TOKEN201703181458_NAME + 03: ./write_on_stdout TOKEN201703181458_VALUE2 >> $TOKEN201703181458_NAME STDOUT:  SUCCESS expected_to be_empty @@ -1771,8 +1998,8 @@  (no output) MISC: - FAILURE expected_to create_file `TOKEN201703172323_FILENAME` matching_regex `^TOKEN201703172323_VALUE1$` - FAILURE expected_to create_file `TOKEN201703172323_FILENAME` matching_regex `^TOKEN201703172323_VALUE2$` + FAILURE expected_to create_file `TOKEN201703181458_FILENAME` matching_regex `^TOKEN201703181458_VALUE1$` + FAILURE expected_to create_file `TOKEN201703181458_FILENAME` matching_regex `^TOKEN201703181458_VALUE2$`  SUCCESS expected_to exit_with_status `0` ---------------------------------------------------------------- @@ -1783,15 +2010,15 @@  The purpose of this test is to check that the tilde expansion `~` in variable declaration. Before test: - 01: export "HOME=/TOKEN201703172323" + 01: export "HOME=/TOKEN201703181458" STDIN: - 01: TOKEN201703172323=~ - 02: ./write_on_stdout TILDE:$TOKEN201703172323 + 01: TOKEN201703181458=~ + 02: ./write_on_stdout TILDE:$TOKEN201703181458 STDOUT:  FAILURE expected_to_not match_regex `TILDE:~` - WARNING might match_regex `TILDE:/TOKEN201703172323` + WARNING might match_regex `TILDE:/TOKEN201703181458`  01: TILDE:~ STDERR: @@ -1806,10 +2033,10 @@  The purpose of this test is to check that a double-quote `"` may be preserved when it is preceded by a backslash `\\`. STDIN: - 01: ./write_on_stdout "TOKEN201703172323 \" TOKEN201703172323" + 01: ./write_on_stdout "TOKEN201703181458 \" TOKEN201703181458" STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323 ` TOKEN201703172323$` + FAILURE expected_to match_regex `^TOKEN201703181458 ` TOKEN201703181458$`  (no output) STDERR: @@ -1842,11 +2069,11 @@  The purpose of this test is to check that using backslash `\\` before the closing double-quote `"` does result in syntax error. STDIN: - 01: ./write_on_stdout "TOKEN201703172323\" + 01: ./write_on_stdout "TOKEN201703181458\" STDOUT: - SUCCESS expected_to_not match_regex `^TOKEN201703172323$` - 01: TOKEN201703172323\ + SUCCESS expected_to_not match_regex `^TOKEN201703181458$` + 01: TOKEN201703181458\ STDERR:  FAILURE expected_to_not be_empty @@ -1861,11 +2088,11 @@  The purpose of this test is to check that using two backslashes `\\` before the symbol double-quote `"` does not result in escaped inhibitors. STDIN: - 01: ./write_on_stdout \\"TOKEN201703172323\\" + 01: ./write_on_stdout \\"TOKEN201703181458\\" STDOUT: - FAILURE expected_to match_regex `^\TOKEN201703172323\$` - 01: \TOKEN201703172323\\ + FAILURE expected_to match_regex `^\TOKEN201703181458\$` + 01: \TOKEN201703181458\\ STDERR:  SUCCESS expected_to be_empty @@ -1941,6 +2168,65 @@ ---------------------------------------------------------------- +42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/001-it-works-1 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout ["a"] + + STDOUT: + SUCCESS expected_to_not match_regex `[[]a]@` + FAILURE expected_to match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/double-quotes/mixed/globbing/bracket-expansion/002-it-works-2 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout ["a"bc"def"gh] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `g@` + FAILURE expected_to match_regex `h@` + SUCCESS expected_to_not match_regex `bc` + SUCCESS expected_to_not match_regex `def` + SUCCESS expected_to_not match_regex `gh` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + 42sh/quoting/mixed/globbing/brace-expansion/001-it-does-not-expand-braces-1 (FAILED) Description: @@ -1958,20 +2244,79 @@ ---------------------------------------------------------------- +42sh/quoting/mixed/globbing/bracket-expansion/001-it-works-1 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout [""'a'""] + + STDOUT: + SUCCESS expected_to_not match_regex `[[]a]@` + FAILURE expected_to match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/mixed/globbing/bracket-expansion/002-it-works-2 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout ["a"bc'def'gh] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `g@` + FAILURE expected_to match_regex `h@` + SUCCESS expected_to_not match_regex `bc` + SUCCESS expected_to_not match_regex `def` + SUCCESS expected_to_not match_regex `gh` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + 42sh/quoting/mixed/variable-expansion/001-it-does-not-expand-in-quotes (FAILED) Description:  The purpose of this test is to check if a local variable is display correctly inside simple and double quote. Before test: - 01: export "TOKEN201703172323_NAME=TOKEN201703172323_VALUE" + 01: export "TOKEN201703181458_NAME=TOKEN201703181458_VALUE" STDIN: - 01: ./write_on_stdout "$TOKEN201703172323_NAME"$TOKEN201703172323_NAME'$TOKEN201703172323_NAME' + 01: ./write_on_stdout "$TOKEN201703181458_NAME"$TOKEN201703181458_NAME'$TOKEN201703181458_NAME' STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323_VALUETOKEN201703172323_VALUE[$]TOKEN201703172323_NAME` - 01: TOKEN201703172323_VALUEE$TOKEN201703172323_NAME + FAILURE expected_to match_regex `TOKEN201703181458_VALUETOKEN201703181458_VALUE[$]TOKEN201703181458_NAME` + 01: TOKEN201703181458_VALUEE$TOKEN201703181458_NAME STDERR:  SUCCESS expected_to be_empty @@ -2047,59 +2392,170 @@ ---------------------------------------------------------------- +42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/001-it-works-1 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout ['a'] + + STDOUT: + SUCCESS expected_to_not match_regex `[[]a]@` + FAILURE expected_to match_regex `^a@$` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/quoting/simple-quotes/mixed/globbing/bracket-expansion/002-it-works-2 (FAILED) + + Description: + The purpose of this test is to check that an argument made with quoted and unquoted parts results in bracket pattern expansion. + + Before test: + 01: rm -rf "./test_globbing" + 02: mkdir "./test_globbing" + 03: cd "./test_globbing" + 04: touch 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' + + STDIN: + 01: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_all_arguments_on_stdout ['a'bc'def'gh] + + STDOUT: + FAILURE expected_to match_regex `a@` + FAILURE expected_to match_regex `b@` + FAILURE expected_to match_regex `c@` + FAILURE expected_to match_regex `d@` + FAILURE expected_to match_regex `e@` + FAILURE expected_to match_regex `f@` + FAILURE expected_to match_regex `g@` + FAILURE expected_to match_regex `h@` + SUCCESS expected_to_not match_regex `bc` + SUCCESS expected_to_not match_regex `def` + SUCCESS expected_to_not match_regex `gh` + (no output) + + STDERR: + FAILURE expected_to be_empty + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory + +---------------------------------------------------------------- + +42sh/shellscript/while/007-pipe-and-while (FAILED) + + Description: + The purpose of this test is to check that a command could be piped inside a while  + + Before test: + 01: ./create-file TOKEN201703181458 + + STDIN: + 01: ./write_on_stdout_and_stderr TOKEN201703181458_stdout TOKEN201703181458_stderr | while [ -f TOKEN201703181458_FILE ] + 02: do + 03: ./read_on_stdin_once + 04: ./delete-file TOKEN201703181458_FILE + 05: done + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703181458_stdout@$` + (no output) + + STDERR: + 01: TOKEN201703181458_stderr + 02: minishell: ./read_on_stdin_once: no such file or directory + +---------------------------------------------------------------- + +42sh/shellscript/while/008-redir-and-while (FAILED) + + Description: + The purpose of this test is to check that a redirection after the while output the result in a file + + Before test: + 01: ./create-file TOKEN201703181458 + + STDIN: + 01: while [ -f TOKEN201703181458_FILE ] + 02: do + 03: ./write_on_stdout TOKEN201703181458_stdout + 04: ./delete-file TOKEN201703181458_FILE + 05: done > TOKEN201703181458_OUTPUT  + + STDOUT: + FAILURE expected_to match_regex `TOKEN201703181458_stdout` + (no output) + + STDERR: + (no output) + + MISC: + SUCCESS expected_to create_file `TOKEN201703181458_OUTPUT` matching_regex `TOKEN201703181458_stdout` + +---------------------------------------------------------------- + 42sh/subshell/mixed/inline-environment-variable/001-modifies-the-child-environment-only-1 (FAILED) Description:  The purpose of this test is to check that declaring a variable and specifying a binary in a subshell does not result in local variable declaration or a modified parent shell's environment, but only a modified child's environment. STDIN: - 01: (TOKEN201703172323_NAME=TOKEN201703172323_VALUE ./display_env) + 01: (TOKEN201703181458_NAME=TOKEN201703181458_VALUE ./display_env) 02: ./display_env STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE$` once + FAILURE expected_to match_regex `^TOKEN201703181458_NAME=TOKEN201703181458_VALUE$` once  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 08: TERM_PROGRAM_VERSION=3.0.10 - 09: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 09: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 10: ZSH=/Users/ariard/.oh-my-zsh 11: USER=ariard - 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 14: PAGER=less - 15: TMUX=/private/tmp/tmux-18965/default,83855,1 + 15: TMUX=/private/tmp/tmux-18965/default,63199,0 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 17: LSCOLORS=Gxfxcxdxbxegedabagacad 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 19: MAIL=ariard@student.42.fr - 20: PWD=/Users/ariard/42shelltest-tmp/tmp + 20: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 21: LANG=en_US.UTF-8 22: ITERM_PROFILE=Default 23: XPC_FLAGS=0x0 - 24: TMUX_PANE=%8 + 24: TMUX_PANE=%2 25: XPC_SERVICE_NAME=0 26: SHLVL=4 27: HOME=/Users/ariard 28: COLORFGBG=7;0 - 29: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 29: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 30: LOGNAME=ariard 31: LESS=-R 32: LC_CTYPE=en_US.UTF-8 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 34: OLDPWD=/Users/ariard/42shelltest-tmp - 35: _=/Users/ariard/Projects/42sh/42sh + 34: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 35: _=../../42sh 36: ?=127 37: ------------------------------ 38: TOTAL ENVIRONMENT VARIABLES: 35 STDERR:  FAILURE expected_to be_empty - 01: minishell: command not found: TOKEN201703172323_NAME=TOKEN201703172323_VALUE + 01: minishell: command not found: TOKEN201703181458_NAME=TOKEN201703181458_VALUE ---------------------------------------------------------------- @@ -2109,53 +2565,53 @@  The purpose of this test is to check that declaring a variable and specifying a binary in a subshell does not result in local variable declaration or a modified parent shell's environment, but only a modified child's environment. STDIN: - 01: ( (TOKEN201703172323_NAME=TOKEN201703172323_VALUE ./display_env) ; ./display_env) ; ./display_env + 01: ( (TOKEN201703181458_NAME=TOKEN201703181458_VALUE ./display_env) ; ./display_env) ; ./display_env 02:  STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_NAME=TOKEN201703172323_VALUE$` once + FAILURE expected_to match_regex `^TOKEN201703181458_NAME=TOKEN201703181458_VALUE$` once  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 08: TERM_PROGRAM_VERSION=3.0.10 - 09: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 09: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 10: ZSH=/Users/ariard/.oh-my-zsh 11: USER=ariard - 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 14: PAGER=less - 15: TMUX=/private/tmp/tmux-18965/default,83855,1 + 15: TMUX=/private/tmp/tmux-18965/default,63199,0 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 17: LSCOLORS=Gxfxcxdxbxegedabagacad 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 19: MAIL=ariard@student.42.fr - 20: PWD=/Users/ariard/42shelltest-tmp/tmp + 20: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 21: LANG=en_US.UTF-8 22: ITERM_PROFILE=Default 23: XPC_FLAGS=0x0 - 24: TMUX_PANE=%8 + 24: TMUX_PANE=%2 25: XPC_SERVICE_NAME=0 26: SHLVL=4 27: HOME=/Users/ariard 28: COLORFGBG=7;0 - 29: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 29: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 30: LOGNAME=ariard 31: LESS=-R 32: LC_CTYPE=en_US.UTF-8 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 34: OLDPWD=/Users/ariard/42shelltest-tmp - 35: _=/Users/ariard/Projects/42sh/42sh + 34: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 35: _=../../42sh 36: ?=127 37: ------------------------------ 38: TOTAL ENVIRONMENT VARIABLES: 35 STDERR:  FAILURE expected_to be_empty - 01: minishell: command not found: TOKEN201703172323_NAME=TOKEN201703172323_VALUE + 01: minishell: command not found: TOKEN201703181458_NAME=TOKEN201703181458_VALUE ---------------------------------------------------------------- @@ -2165,14 +2621,14 @@  The purpose of this test is to check that pipes and subshells run twice together in harmony. STDIN: - 01: ( ( (cd / ; /Users/ariard/42shelltest-tmp/tmp/display_pwd) | ./read_on_stdin) ) | ( ( (./read_on_stdin) ) | ./read_on_stdin ) - 02: ./write_on_stdout TOKEN201703172323 + 01: ( ( (cd / ; /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd) | ./read_on_stdin) ) | ( ( (./read_on_stdin) ) | ./read_on_stdin ) + 02: ./write_on_stdout TOKEN201703181458 STDOUT: - SUCCESS expected_to_not match_regex `/Users/ariard/42shelltest-tmp/tmp` + SUCCESS expected_to_not match_regex `/Users/ariard/Projects/42sh/42shelltest-tmp/tmp`  FAILURE expected_to match_regex `^PWD:/:PWD@@@$` - SUCCESS expected_to match_regex `TOKEN201703172323` - 01: TOKEN201703172323 + SUCCESS expected_to match_regex `TOKEN201703181458` + 01: TOKEN201703181458 STDERR:  FAILURE expected_to be_empty @@ -2186,56 +2642,56 @@  The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. Before test: - 01: unset "TOKEN201703172323_VARIABLE" + 01: unset "TOKEN201703181458_VARIABLE" STDIN: - 01: TOKEN201703172323_VARIABLE=TOKEN201703172323_VALUE ./display_env + 01: TOKEN201703181458_VARIABLE=TOKEN201703181458_VALUE ./display_env 02: ./display_env STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_VARIABLE=TOKEN201703172323_VALUE$` once + FAILURE expected_to match_regex `^TOKEN201703181458_VARIABLE=TOKEN201703181458_VALUE$` once  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 08: TERM_PROGRAM_VERSION=3.0.10 - 09: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 09: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 10: ZSH=/Users/ariard/.oh-my-zsh 11: USER=ariard - 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 14: PAGER=less - 15: TMUX=/private/tmp/tmux-18965/default,83855,1 + 15: TMUX=/private/tmp/tmux-18965/default,63199,0 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 17: LSCOLORS=Gxfxcxdxbxegedabagacad 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 19: MAIL=ariard@student.42.fr - 20: PWD=/Users/ariard/42shelltest-tmp/tmp + 20: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 21: LANG=en_US.UTF-8 22: ITERM_PROFILE=Default 23: XPC_FLAGS=0x0 - 24: TMUX_PANE=%8 + 24: TMUX_PANE=%2 25: XPC_SERVICE_NAME=0 26: SHLVL=4 27: HOME=/Users/ariard 28: COLORFGBG=7;0 - 29: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 29: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 30: LOGNAME=ariard 31: LESS=-R 32: LC_CTYPE=en_US.UTF-8 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 34: OLDPWD=/Users/ariard/42shelltest-tmp - 35: _=/Users/ariard/Projects/42sh/42sh + 34: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 35: _=../../42sh 36: ?=127 37: ------------------------------ 38: TOTAL ENVIRONMENT VARIABLES: 35 STDERR:  FAILURE expected_to be_empty - 01: minishell: command not found: TOKEN201703172323_VARIABLE=TOKEN201703172323_VALUE + 01: minishell: command not found: TOKEN201703181458_VARIABLE=TOKEN201703181458_VALUE ---------------------------------------------------------------- @@ -2245,58 +2701,58 @@  The purpose of this test is to check that a binary may have its environment to be modified by appending variables inline. Before test: - 01: unset "TOKEN201703172323_VARIABLE" + 01: unset "TOKEN201703181458_VARIABLE" STDIN: - 01: TOKEN201703172323_VARIABLE1=TOKEN201703172323_VALUE1 TOKEN201703172323_VARIABLE2=TOKEN201703172323_VALUE2 TOKEN201703172323_VARIABLE3=TOKEN201703172323_VALUE3 ./display_env + 01: TOKEN201703181458_VARIABLE1=TOKEN201703181458_VALUE1 TOKEN201703181458_VARIABLE2=TOKEN201703181458_VALUE2 TOKEN201703181458_VARIABLE3=TOKEN201703181458_VALUE3 ./display_env 02: ./display_env STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323_VARIABLE1=TOKEN201703172323_VALUE1$` once - FAILURE expected_to match_regex `^TOKEN201703172323_VARIABLE2=TOKEN201703172323_VALUE2$` once - FAILURE expected_to match_regex `^TOKEN201703172323_VARIABLE3=TOKEN201703172323_VALUE3$` once + FAILURE expected_to match_regex `^TOKEN201703181458_VARIABLE1=TOKEN201703181458_VALUE1$` once + FAILURE expected_to match_regex `^TOKEN201703181458_VARIABLE2=TOKEN201703181458_VALUE2$` once + FAILURE expected_to match_regex `^TOKEN201703181458_VARIABLE3=TOKEN201703181458_VALUE3$` once  01: ------------------------------ 02: TERM_PROGRAM=iTerm.app 03: TERM=screen-256color 04: SHELL=/bin/zsh 05: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 06: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 07: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 08: TERM_PROGRAM_VERSION=3.0.10 - 09: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 09: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 10: ZSH=/Users/ariard/.oh-my-zsh 11: USER=ariard - 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 12: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 13: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 14: PAGER=less - 15: TMUX=/private/tmp/tmux-18965/default,83855,1 + 15: TMUX=/private/tmp/tmux-18965/default,63199,0 16: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 17: LSCOLORS=Gxfxcxdxbxegedabagacad 18: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 19: MAIL=ariard@student.42.fr - 20: PWD=/Users/ariard/42shelltest-tmp/tmp + 20: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp 21: LANG=en_US.UTF-8 22: ITERM_PROFILE=Default 23: XPC_FLAGS=0x0 - 24: TMUX_PANE=%8 + 24: TMUX_PANE=%2 25: XPC_SERVICE_NAME=0 26: SHLVL=4 27: HOME=/Users/ariard 28: COLORFGBG=7;0 - 29: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 29: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 30: LOGNAME=ariard 31: LESS=-R 32: LC_CTYPE=en_US.UTF-8 33: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 34: OLDPWD=/Users/ariard/42shelltest-tmp - 35: _=/Users/ariard/Projects/42sh/42sh + 34: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp + 35: _=../../42sh 36: ?=127 37: ------------------------------ 38: TOTAL ENVIRONMENT VARIABLES: 35 STDERR:  FAILURE expected_to be_empty - 01: minishell: command not found: TOKEN201703172323_VARIABLE1=TOKEN201703172323_VALUE1 + 01: minishell: command not found: TOKEN201703181458_VARIABLE1=TOKEN201703181458_VALUE1 ---------------------------------------------------------------- @@ -2311,18 +2767,17 @@ 03: cd "temporary_directory" STDIN: - 01: PATH=.. write_on_stdout TOKEN201703172323 + 01: PATH=.. write_on_stdout TOKEN201703181458 02: exit_with_status 42 STDOUT: - FAILURE expected_to match_regex `^TOKEN201703172323$` + FAILURE expected_to match_regex `^TOKEN201703181458$`  (no output) STDERR:  SUCCESS expected_to_not be_empty - SUCCESS might match_regex `[Cc]ommand not found` - 01: minishell: command not found: PATH=.. - 02: minishell: command not found: exit_with_status + WARNING might match_regex `[Cc]ommand not found` + 01: ./lib/main.sh: line 102: ../../42sh: No such file or directory MISC:  SUCCESS expected_to_not exit_with_status `42` @@ -2338,10 +2793,10 @@ If not, the Shell should display an error and exit with an error status code. STDIN: - 01: && ./write_on_stdout TOKEN201703172323 + 01: && ./write_on_stdout TOKEN201703181458 STDOUT: - SUCCESS might_not match_regex `TOKEN201703172323` + SUCCESS might_not match_regex `TOKEN201703181458`  SUCCESS might be_empty  (no output) @@ -2363,10 +2818,10 @@ It should not execute the two commands `write_on_stdout` but display an error and exit with an error status code. STDIN: - 01: ./write_on_stdout TOKEN201703172323 &&& ./write_on_stdout TOKEN201703172323 + 01: ./write_on_stdout TOKEN201703181458 &&& ./write_on_stdout TOKEN201703181458 STDOUT: - SUCCESS might_not match_regex `TOKEN201703172323` + SUCCESS might_not match_regex `TOKEN201703181458`  SUCCESS might be_empty  (no output) @@ -2388,7 +2843,7 @@ If not, the Shell should display an error and exit with an error status code. STDIN: - 01: || ./write_on_stdout TOKEN201703172323 + 01: || ./write_on_stdout TOKEN201703181458 STDOUT:  SUCCESS might be_empty @@ -2412,7 +2867,7 @@ The Shell should display an error and exit with a error status code. STDIN: - 01: ./write_on_stdout TOKEN201703172323 ||| ./write_on_stdout TOKEN201703172323 + 01: ./write_on_stdout TOKEN201703181458 ||| ./write_on_stdout TOKEN201703181458 STDOUT:  SUCCESS might be_empty @@ -2434,16 +2889,16 @@  The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable PWD when followed by the symbol `+`. Before test: - 01: export "HOME=/TOKEN201703172323" + 01: export "HOME=/TOKEN201703181458" STDIN:  01: ./write_on_stdout ~+ STDOUT:  SUCCESS expected_to_not match_regex `~[+]` - FAILURE expected_to_not match_regex `/TOKEN201703172323[+]` - FAILURE expected_to match_regex `^/Users/ariard/42shelltest-tmp/tmp$` - 01: /TOKEN201703172323+ + FAILURE expected_to_not match_regex `/TOKEN201703181458[+]` + FAILURE expected_to match_regex `^/Users/ariard/Projects/42sh/42shelltest-tmp/tmp$` + 01: /TOKEN201703181458+ STDERR:  (no output) @@ -2456,16 +2911,16 @@  The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable PWD when followed by the symbol `+`. Before test: - 01: export "HOME=/TOKEN201703172323" + 01: export "HOME=/TOKEN201703181458" STDIN: - 01: ./write_on_stdout ~+/TOKEN201703172323_SUBDIRECTORY + 01: ./write_on_stdout ~+/TOKEN201703181458_SUBDIRECTORY STDOUT: - SUCCESS expected_to_not match_regex `~+/TOKEN201703172323_SUBDIRECTORY` - FAILURE expected_to_not match_regex `/TOKEN201703172323[+]/TOKEN201703172323_SUBDIRECTORY` - FAILURE expected_to match_regex `^/Users/ariard/42shelltest-tmp/tmp/TOKEN201703172323_SUBDIRECTORY$` - 01: /TOKEN201703172323+/TOKEN201703172323_SUBDIRECTORY + SUCCESS expected_to_not match_regex `~+/TOKEN201703181458_SUBDIRECTORY` + FAILURE expected_to_not match_regex `/TOKEN201703181458[+]/TOKEN201703181458_SUBDIRECTORY` + FAILURE expected_to match_regex `^/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/TOKEN201703181458_SUBDIRECTORY$` + 01: /TOKEN201703181458+/TOKEN201703181458_SUBDIRECTORY STDERR:  (no output) @@ -2478,19 +2933,19 @@  The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable OLDPWD when followed by the symbol `+`. Before test: - 01: rm -rf "./TOKEN201703172323_SUBDIRECTORY" - 02: mkdir "./TOKEN201703172323_SUBDIRECTORY" - 03: export "HOME=/TOKEN201703172323" + 01: rm -rf "./TOKEN201703181458_SUBDIRECTORY" + 02: mkdir "./TOKEN201703181458_SUBDIRECTORY" + 03: export "HOME=/TOKEN201703181458" STDIN: - 01: cd ./TOKEN201703172323_SUBDIRECTORY - 02: /Users/ariard/42shelltest-tmp/tmp/write_on_stdout ~- + 01: cd ./TOKEN201703181458_SUBDIRECTORY + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_on_stdout ~- STDOUT:  SUCCESS expected_to_not match_regex `~-` - FAILURE expected_to_not match_regex `/TOKEN201703172323-` - FAILURE expected_to match_regex `^/Users/ariard/42shelltest-tmp/tmp$` - 01: /TOKEN201703172323- + FAILURE expected_to_not match_regex `/TOKEN201703181458-` + FAILURE expected_to match_regex `^/Users/ariard/Projects/42sh/42shelltest-tmp/tmp$` + 01: /TOKEN201703181458- STDERR:  (no output) @@ -2503,19 +2958,19 @@  The purpose of this test is to check that the symbol tilde `~` may be expanded with the environment variable OLDPWD when followed by the symbol `+`. Before test: - 01: rm -rf "./TOKEN201703172323_SUBDIRECTORY" - 02: mkdir "./TOKEN201703172323_SUBDIRECTORY" - 03: export "HOME=/TOKEN201703172323" + 01: rm -rf "./TOKEN201703181458_SUBDIRECTORY" + 02: mkdir "./TOKEN201703181458_SUBDIRECTORY" + 03: export "HOME=/TOKEN201703181458" STDIN: - 01: cd ./TOKEN201703172323_SUBDIRECTORY - 02: /Users/ariard/42shelltest-tmp/tmp/write_on_stdout ~-/TOKEN201703172323_OTHERDIRECTORY + 01: cd ./TOKEN201703181458_SUBDIRECTORY + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_on_stdout ~-/TOKEN201703181458_OTHERDIRECTORY STDOUT: - SUCCESS expected_to_not match_regex `~-/TOKEN201703172323_OTHERDIRECTORY` - FAILURE expected_to_not match_regex `/TOKEN201703172323-/TOKEN201703172323_OTHERDIRECTORY` - FAILURE expected_to match_regex `^/Users/ariard/42shelltest-tmp/tmp/TOKEN201703172323_OTHERDIRECTORY$` - 01: /TOKEN201703172323-/TOKEN201703172323_OTHERDIRECTORY + SUCCESS expected_to_not match_regex `~-/TOKEN201703181458_OTHERDIRECTORY` + FAILURE expected_to_not match_regex `/TOKEN201703181458-/TOKEN201703181458_OTHERDIRECTORY` + FAILURE expected_to match_regex `^/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/TOKEN201703181458_OTHERDIRECTORY$` + 01: /TOKEN201703181458-/TOKEN201703181458_OTHERDIRECTORY STDERR:  (no output) @@ -2528,15 +2983,15 @@  The purpose of this test is to check that the symbol tilde `~` may be not expanded when not followed by an authorized symbol or user name. Before test: - 01: export "HOME=/TOKEN201703172323" + 01: export "HOME=/TOKEN201703181458" STDIN:  01: ./write_on_stdout ~~ STDOUT:  FAILURE expected_to match_regex `^~~$` - FAILURE expected_to_not match_regex `/TOKEN201703172323` - 01: /TOKEN201703172323~ + FAILURE expected_to_not match_regex `/TOKEN201703181458` + 01: /TOKEN201703181458~ STDERR:  (no output) @@ -2549,15 +3004,15 @@  The purpose of this test is to check that the symbol tilde `~` may be not expanded when not followed by an authorized symbol or user name. Before test: - 01: export "HOME=/TOKEN201703172323" + 01: export "HOME=/TOKEN201703181458" STDIN: - 01: ./write_on_stdout ~TOKEN201703172323_UNKNOWNUSER + 01: ./write_on_stdout ~TOKEN201703181458_UNKNOWNUSER STDOUT: - FAILURE expected_to match_regex `^~TOKEN201703172323_UNKNOWNUSER$` - FAILURE expected_to_not match_regex `/TOKEN201703172323TOKEN201703172323_UNKNOWNUSER` - 01: /TOKEN201703172323TOKEN201703172323_UNKNOWNUSER + FAILURE expected_to match_regex `^~TOKEN201703181458_UNKNOWNUSER$` + FAILURE expected_to_not match_regex `/TOKEN201703181458TOKEN201703181458_UNKNOWNUSER` + 01: /TOKEN201703181458TOKEN201703181458_UNKNOWNUSER STDERR:  (no output) @@ -2570,16 +3025,16 @@  The purpose of this test is to check that the symbol tilde `~` is not expanded with the environment variable PWD when not followed by the symbol `/`. Before test: - 01: export "HOME=/TOKEN201703172323" + 01: export "HOME=/TOKEN201703181458" STDIN: - 01: ./write_on_stdout ~+TOKEN201703172323_SUBDIRECTORY + 01: ./write_on_stdout ~+TOKEN201703181458_SUBDIRECTORY STDOUT: - FAILURE expected_to match_regex `^~[+]TOKEN201703172323_SUBDIRECTORY$` - FAILURE expected_to_not match_regex `/TOKEN201703172323[+]TOKEN201703172323_SUBDIRECTORY` - SUCCESS expected_to_not match_regex `/Users/ariard/42shelltest-tmp/tmpTOKEN201703172323_SUBDIRECTORY` - 01: /TOKEN201703172323+TOKEN201703172323_SUBDIRECTORY + FAILURE expected_to match_regex `^~[+]TOKEN201703181458_SUBDIRECTORY$` + FAILURE expected_to_not match_regex `/TOKEN201703181458[+]TOKEN201703181458_SUBDIRECTORY` + SUCCESS expected_to_not match_regex `/Users/ariard/Projects/42sh/42shelltest-tmp/tmpTOKEN201703181458_SUBDIRECTORY` + 01: /TOKEN201703181458+TOKEN201703181458_SUBDIRECTORY STDERR:  (no output) @@ -2592,19 +3047,19 @@  The purpose of this test is to check that the symbol tilde `~` is not expanded with the environment variable OLDPWD when not followed by the symbol `/`. Before test: - 01: rm -rf "./TOKEN201703172323_SUBDIRECTORY" - 02: mkdir "./TOKEN201703172323_SUBDIRECTORY" - 03: export "HOME=/TOKEN201703172323" + 01: rm -rf "./TOKEN201703181458_SUBDIRECTORY" + 02: mkdir "./TOKEN201703181458_SUBDIRECTORY" + 03: export "HOME=/TOKEN201703181458" STDIN: - 01: cd ./TOKEN201703172323_SUBDIRECTORY - 02: /Users/ariard/42shelltest-tmp/tmp/write_on_stdout ~-TOKEN201703172323_OTHERDIRECTORY + 01: cd ./TOKEN201703181458_SUBDIRECTORY + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/write_on_stdout ~-TOKEN201703181458_OTHERDIRECTORY STDOUT: - FAILURE expected_to match_regex `^~-TOKEN201703172323_OTHERDIRECTORY$` - SUCCESS expected_to_not match_regex `/TOKEN201703172323-/TOKEN201703172323_OTHERDIRECTORY` - SUCCESS expected_to_not match_regex `/Users/ariard/42shelltest-tmp/tmp/TOKEN201703172323_OTHERDIRECTORY` - 01: /TOKEN201703172323-TOKEN201703172323_OTHERDIRECTORY + FAILURE expected_to match_regex `^~-TOKEN201703181458_OTHERDIRECTORY$` + SUCCESS expected_to_not match_regex `/TOKEN201703181458-/TOKEN201703181458_OTHERDIRECTORY` + SUCCESS expected_to_not match_regex `/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/TOKEN201703181458_OTHERDIRECTORY` + 01: /TOKEN201703181458-TOKEN201703181458_OTHERDIRECTORY STDERR:  (no output) @@ -2620,10 +3075,10 @@  01: export PATH="" STDIN: - 01: write_on_stdout "TOKEN201703172323" + 01: write_on_stdout "TOKEN201703181458" STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323` + FAILURE expected_to match_regex `TOKEN201703181458`  (no output) STDERR: @@ -2641,15 +3096,15 @@  The purpose of this test is to check that the Shell retrieves the default value of the environment variable PATH if not set. This test depends on the presence of the UNIX binary `ls`, located in a path within the default environment variable PATH. Before test: - 01: rm -rf "TOKEN201703172323_006-BINARY-UNDEFINED-PATH" - 02: touch "TOKEN201703172323_006-BINARY-UNDEFINED-PATH" + 01: rm -rf "TOKEN201703181458_006-BINARY-UNDEFINED-PATH" + 02: touch "TOKEN201703181458_006-BINARY-UNDEFINED-PATH" 03: unset PATH STDIN:  01: ls STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323_006-BINARY-UNDEFINED-PATH` + FAILURE expected_to match_regex `TOKEN201703181458_006-BINARY-UNDEFINED-PATH`  (no output) STDERR: @@ -2701,48 +3156,48 @@ STDIN:  01: cd symbolic_link - 02: /Users/ariard/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/42shelltest-tmp/tmp/display_env + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd + 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/42shelltest-tmp/tmp/sub_directory:PWD$` - FAILURE expected_to match_regex `^PWD=/Users/ariard/42shelltest-tmp/tmp/symbolic_link$` - 01: PWD:/Users/ariard/42shelltest-tmp/tmp/sub_directory:PWD + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD$` + FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/symbolic_link$` + 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD 02: ------------------------------ 03: TERM_PROGRAM=iTerm.app 04: TERM=screen-256color 05: SHELL=/bin/zsh 06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 09: TERM_PROGRAM_VERSION=3.0.10 - 10: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 10: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 11: ZSH=/Users/ariard/.oh-my-zsh 12: USER=ariard - 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 15: PAGER=less - 16: TMUX=/private/tmp/tmux-18965/default,83855,1 + 16: TMUX=/private/tmp/tmux-18965/default,63199,0 17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 18: LSCOLORS=Gxfxcxdxbxegedabagacad 19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 20: MAIL=ariard@student.42.fr - 21: PWD=/Users/ariard/42shelltest-tmp/tmp/sub_directory + 21: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory 22: LANG=en_US.UTF-8 23: ITERM_PROFILE=Default 24: XPC_FLAGS=0x0 - 25: TMUX_PANE=%8 + 25: TMUX_PANE=%2 26: XPC_SERVICE_NAME=0 27: SHLVL=4 28: HOME=/Users/ariard 29: COLORFGBG=7;0 - 30: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 30: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 31: LOGNAME=ariard 32: LESS=-R 33: LC_CTYPE=en_US.UTF-8 34: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 35: OLDPWD=/Users/ariard/42shelltest-tmp/tmp - 36: _=/Users/ariard/Projects/42sh/42sh + 35: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp + 36: _=../../42sh 37: ?=0 38: ------------------------------ 39: TOTAL ENVIRONMENT VARIABLES: 35 @@ -2766,48 +3221,48 @@ STDIN:  01: cd symbolic_link2 - 02: /Users/ariard/42shelltest-tmp/tmp/display_pwd - 03: /Users/ariard/42shelltest-tmp/tmp/display_env + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd + 03: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_env STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/42shelltest-tmp/tmp/sub_directory:PWD$` - FAILURE expected_to match_regex `^PWD=/Users/ariard/42shelltest-tmp/tmp/symbolic_link2$` - 01: PWD:/Users/ariard/42shelltest-tmp/tmp/sub_directory:PWD + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD$` + FAILURE expected_to match_regex `^PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/symbolic_link2$` + 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory:PWD 02: ------------------------------ 03: TERM_PROGRAM=iTerm.app 04: TERM=screen-256color 05: SHELL=/bin/zsh 06: HOMEBREW_TEMP=/tmp/ariard/Homebrew/Temp 07: TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n0002_2m000khn/T/ - 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.uRjg1YTz1a/Render + 08: Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.8FeUPqmXvW/Render 09: TERM_PROGRAM_VERSION=3.0.10 - 10: TERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 10: TERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 11: ZSH=/Users/ariard/.oh-my-zsh 12: USER=ariard - 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.lQz9opv8hX/Listeners + 13: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4g7aCI4G8f/Listeners 14: __CF_USER_TEXT_ENCODING=0x4A15:0x0:0x0 15: PAGER=less - 16: TMUX=/private/tmp/tmux-18965/default,83855,1 + 16: TMUX=/private/tmp/tmux-18965/default,63199,0 17: HOMEBREW_CACHE=/tmp/ariard/Homebrew/Caches 18: LSCOLORS=Gxfxcxdxbxegedabagacad 19: PATH=/Users/ariard/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki://Users/ariard/local/bin 20: MAIL=ariard@student.42.fr - 21: PWD=/Users/ariard/42shelltest-tmp/tmp/sub_directory + 21: PWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp/sub_directory 22: LANG=en_US.UTF-8 23: ITERM_PROFILE=Default 24: XPC_FLAGS=0x0 - 25: TMUX_PANE=%8 + 25: TMUX_PANE=%2 26: XPC_SERVICE_NAME=0 27: SHLVL=4 28: HOME=/Users/ariard 29: COLORFGBG=7;0 - 30: ITERM_SESSION_ID=w0t0p1:012161CB-942E-417B-AD70-740FF5490A87 + 30: ITERM_SESSION_ID=w0t0p1:84CB76AE-945F-4CD5-ACBE-549A47629FD9 31: LOGNAME=ariard 32: LESS=-R 33: LC_CTYPE=en_US.UTF-8 34: TMUX_PLUGIN_MANAGER_PATH=/Users/ariard/.tmux/plugins/ - 35: OLDPWD=/Users/ariard/42shelltest-tmp/tmp - 36: _=/Users/ariard/Projects/42sh/42sh + 35: OLDPWD=/Users/ariard/Projects/42sh/42shelltest-tmp/tmp + 36: _=../../42sh 37: ?=0 38: ------------------------------ 39: TOTAL ENVIRONMENT VARIABLES: 35 @@ -2828,11 +3283,11 @@ STDIN:  01: cd not_a_directory - 02: /Users/ariard/42shelltest-tmp/tmp/display_pwd + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/42shelltest-tmp/tmp:PWD` - 01: PWD:/Users/ariard/42shelltest-tmp/tmp:PWD + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` + 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD STDERR:  SUCCESS expected_to_not be_empty @@ -2853,11 +3308,11 @@ STDIN:  01: cd permission_denied - 02: /Users/ariard/42shelltest-tmp/tmp/display_pwd + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/42shelltest-tmp/tmp:PWD` - 01: PWD:/Users/ariard/42shelltest-tmp/tmp:PWD + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` + 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD STDERR:  SUCCESS expected_to_not be_empty @@ -2883,11 +3338,11 @@ STDIN:  01: cd symbolic_link1 - 02: /Users/ariard/42shelltest-tmp/tmp/display_pwd + 02: /Users/ariard/Projects/42sh/42shelltest-tmp/tmp/display_pwd STDOUT: - SUCCESS expected_to match_regex `PWD:/Users/ariard/42shelltest-tmp/tmp:PWD` - 01: PWD:/Users/ariard/42shelltest-tmp/tmp:PWD + SUCCESS expected_to match_regex `PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD` + 01: PWD:/Users/ariard/Projects/42sh/42shelltest-tmp/tmp:PWD STDERR:  SUCCESS expected_to_not be_empty @@ -2906,35 +3361,15 @@ STDOUT:  FAILURE expected_to match_regex `TOTAL ENVIRONMENT VARIABLES: 0` - (no output) + 01: ------------------------------ + 02: ?=0 + 03: ------------------------------ + 04: TOTAL ENVIRONMENT VARIABLES: 1 STDERR: - FAILURE expected_to be_empty - 01: minishell: no such file or directory: ./display_env - ----------------------------------------------------------------- - -minishell/builtins/env/005-set-variables (FAILED) - - Description: - The purpose of this test is to check that the builtin `env` can modify or set multiple environment variables before executing the given command. - - Before test: - 01: export VARTEST1="OLD_VALUE" - - STDIN: - 01: env VARTEST1=TOKEN201703172323_1 VARTEST2=TOKEN201703172323_2 VARTEST3=TOKEN201703172323_3 ./display_env - - STDOUT: - FAILURE expected_to match_regex `VARTEST1=TOKEN201703172323_1` - FAILURE expected_to match_regex `VARTEST2=TOKEN201703172323_2` - FAILURE expected_to match_regex `VARTEST3=TOKEN201703172323_3` + SUCCESS expected_to be_empty  (no output) - STDERR: - FAILURE expected_to be_empty - 01: minishell: no such file or directory: ./display_env - ---------------------------------------------------------------- minishell/builtins/env/errors/001-command-not-found (FAILED) @@ -2954,33 +3389,7 @@ STDERR:  SUCCESS expected_to_not be_empty  WARNING might match_regex `[Cc]ommand not found` - 01: minishell: no such file or directory: ./invalid_binary - - MISC: - FAILURE expected_to_not exit_with_status `0` - ----------------------------------------------------------------- - -minishell/builtins/env/errors/002-illegal-option (FAILED) - - Description: - The purpose of this test is to check that using the builtin `env` with an invalid option results in an error and failure exit status. - - Before test: - 01: rm -f -- "-w" - - STDIN: - 01: env -w - - STDOUT: - (no output) - - STDERR: - SUCCESS expected_to_not be_empty - WARNING might match_regex `([Ii]nvalid|[Ii]llegal) (option|argument)` - 01: env: option requires an argument -- w - 02: usage: env [-iv] [-P utilpath] [-S string] [-u name] - 03: [name=value ...] [utility [argument ...]] + 01: minishell: ./invalid_binary: no such file or directory MISC:  FAILURE expected_to_not exit_with_status `0` @@ -2993,16 +3402,20 @@  The purpose of this test is to check that `env -i` works if we use a second argument to set an environment variable, we are also checking if this command unset environments variables for a given binary. STDIN: - 01: env -i TESTVARIABLE=TOKEN201703172323 ./display_env + 01: env -i TESTVARIABLE=TOKEN201703181458 ./display_env STDOUT: - FAILURE expected_to match_regex `TESTVARIABLE=TOKEN201703172323` + SUCCESS expected_to match_regex `TESTVARIABLE=TOKEN201703181458`  FAILURE expected_to match_regex `TOTAL ENVIRONMENT VARIABLES: 1` - (no output) + 01: ------------------------------ + 02: TESTVARIABLE=TOKEN201703181458 + 03: ?=0 + 04: ------------------------------ + 05: TOTAL ENVIRONMENT VARIABLES: 2 STDERR: - FAILURE expected_to be_empty - 01: minishell: no such file or directory: ./display_env + SUCCESS expected_to be_empty + (no output) ---------------------------------------------------------------- @@ -3013,10 +3426,10 @@ STDIN:  01: exit 21 42 - 02: ./write_on_stdout TOKEN201703172323 + 02: ./write_on_stdout TOKEN201703181458 STDOUT: - FAILURE expected_to match_regex `TOKEN201703172323` + FAILURE expected_to match_regex `TOKEN201703181458`  (no output) STDERR: @@ -3036,10 +3449,10 @@ STDIN:  01: exit abc - 02: ./write_on_stdout TOKEN201703172323 + 02: ./write_on_stdout TOKEN201703181458 STDOUT: - SUCCESS expected_to_not match_regex `TOKEN201703172323` + SUCCESS expected_to_not match_regex `TOKEN201703181458`  (no output) STDERR: @@ -3070,6 +3483,6 @@  WARNING might match_regex `(not.*identifier|must begin.*letter)`  (no output) -Total tests: 296 -Total failed tests: 105 +Total tests: 300 +Total failed tests: 121 Total pending tests: 3 diff --git a/42sh/src/parser/add_subshell.c b/42sh/src/parser/add_subshell.c index 18e6af51..5b70e8da 100644 --- a/42sh/src/parser/add_subshell.c +++ b/42sh/src/parser/add_subshell.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/24 18:41:50 by ariard #+# #+# */ -/* Updated: 2017/03/13 19:04:55 by ariard ### ########.fr */ +/* Updated: 2017/03/18 15:50:28 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -40,9 +40,17 @@ int add_subshell_cmd(t_btree **ast, t_list **lst) token = (*lst)->content; node = (*ast)->item; - if (token->type == TK_PAREN_CLOSE && node->type == SUBSHELL) + if ((token->type == SUBSHELL && node->type == SUBSHELL) + || (token->type == TK_LBRACE && node->type == TK_LBRACE)) + node->nest++; + if (((token->type == TK_PAREN_CLOSE && node->type == SUBSHELL) + || (token->type == TK_RBRACE && node->type == TK_LBRACE)) && node->nest > 0) + node->nest--; + else if (token->type == TK_PAREN_CLOSE && node->type == SUBSHELL + && node->nest == 0) return ((node->full = 1)); - if (token->type == TK_RBRACE && node->type == TK_LBRACE) + else if (token->type == TK_RBRACE && node->type == TK_LBRACE + && node->nest == 0) return ((node->full = 1)); return (add_cmd(&(*ast)->right, lst)); } diff --git a/42sh/src/parser/aggregate_sym.c b/42sh/src/parser/aggregate_sym.c index db393a26..84a6511e 100644 --- a/42sh/src/parser/aggregate_sym.c +++ b/42sh/src/parser/aggregate_sym.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/11 15:58:38 by ariard #+# #+# */ -/* Updated: 2017/03/17 18:23:50 by ariard ### ########.fr */ +/* Updated: 2017/03/18 15:52:52 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/parser/eval_sym.c b/42sh/src/parser/eval_sym.c index 57e91bf1..f3f95ca1 100644 --- a/42sh/src/parser/eval_sym.c +++ b/42sh/src/parser/eval_sym.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/11 16:11:21 by ariard #+# #+# */ -/* Updated: 2017/03/17 18:12:41 by ariard ### ########.fr */ +/* Updated: 2017/03/18 15:51:55 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -413,6 +413,7 @@ t_stackmatch g_stackmatch[] = {TK_LBRACE, LINEBREAK}, {TK_LBRACE, TK_BANG}, {TK_LBRACE, TK_LBRACE}, + {TK_LBRACE, TK_PAREN_OPEN}, {TK_LBRACE, SEPARATOR_OP}, {TK_LBRACE, NEWLINE_LIST}, {TK_LBRACE, SEQUENCE}, diff --git a/42sh/src/parser/ft_parse.c b/42sh/src/parser/ft_parse.c index 395a392e..f47c9d7a 100644 --- a/42sh/src/parser/ft_parse.c +++ b/42sh/src/parser/ft_parse.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/11 16:17:38 by ariard #+# #+# */ -/* Updated: 2017/03/17 18:00:34 by ariard ### ########.fr */ +/* Updated: 2017/03/18 15:46:49 by ariard ### ########.fr */ /* */ /* ************************************************************************** */