7.5 KiB
7.5 KiB
.x........................xxxx....x.
----------------------------------------------------------------
21sh/misc/002-simple-command-line (FAILED)
Description:
The purpose of this test is to check that the Shell is able to execute a simple command line that contains separators `;`, pipes `|`, and a right redirection `>`.
Before test:
01: rm -rf "./size"
02: rm -rf "TOKEN201703270303"
03: echo '^'$(echo TOKEN201703270303_FILE_TOKEN201703270303_STDOUT | wc -c)'$' > "./size"
STDIN:
01: mkdir TOKEN201703270303 ; cd TOKEN201703270303 ; touch TOKEN201703270303_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703270303_STDOUT ; cat TOKEN201703270303_STDOUT
STDOUT:
SUCCESS expected_to match_regex `TOKEN201703270303_FILE$`
FAILURE expected_to match_each_regex_of_file `./size`
01: TOKEN201703270303_FILE
02: 23
STDERR:
SUCCESS expected_to be_empty
(no output)
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/002-together-stdout-first (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `M>&N`, that means `redirect M to where N is redirected`.
In this test the standard output is specified first.
Before test:
01: rm -f new_file_stderr_and_stdout
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 1>new_file_stderr_and_stdout 2>&1
STDOUT:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
MISC:
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
SUCCESS expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/003-together-stderr-first (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `M>&N`, that means `redirect M to where N is redirected`.
In this test the standard error is specified first.
Before test:
01: rm -f new_file_stderr_and_stdout
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 2>new_file_stderr_and_stdout 1>&2
STDOUT:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
MISC:
SUCCESS expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/004-together (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.
Before test:
01: rm -f "new_file_stderr_and_stdout"
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 &>new_file_stderr_and_stdout
STDOUT:
FAILURE expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_1
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
FAILURE expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_2
MISC:
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.
In this test, we specify the file name in a separate field.
Before test:
01: rm -f new_file_stderr_and_stdout
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 &> new_file_stderr_and_stdout
STDOUT:
FAILURE expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_1
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
FAILURE expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_2
MISC:
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/separators/semicolon/003-parse-error-empty-inline-command (FAILED)
Description:
The purpose of this test is to check that using the simicolon separator `;` with empty commands results in error.
STDIN:
01: ./write_on_stdout TOKEN201703270303 ; ; ./exit_with_status 42
STDOUT:
SUCCESS expected_to be_empty
(no output)
STDERR:
SUCCESS expected_to_not be_empty
SUCCESS might match_regex `([Ss]yntax|[Pp]arse) error`
01: syntax error near unexpected token `;'
MISC:
SUCCESS expected_to_not exit_with_status `42`
FAILURE expected_to_not exit_with_status `0`
Total tests: 36
Total failed tests: 6
Total pending tests: 0
----------------------------------------------------------------
21sh/misc/002-simple-command-line (FAILED)
Description:
The purpose of this test is to check that the Shell is able to execute a simple command line that contains separators `;`, pipes `|`, and a right redirection `>`.
Before test:
01: rm -rf "./size"
02: rm -rf "TOKEN201703270303"
03: echo '^'$(echo TOKEN201703270303_FILE_TOKEN201703270303_STDOUT | wc -c)'$' > "./size"
STDIN:
01: mkdir TOKEN201703270303 ; cd TOKEN201703270303 ; touch TOKEN201703270303_FILE ; ls -1 ; ls | cat | wc -c > TOKEN201703270303_STDOUT ; cat TOKEN201703270303_STDOUT
STDOUT:
SUCCESS expected_to match_regex `TOKEN201703270303_FILE$`
FAILURE expected_to match_each_regex_of_file `./size`
01: TOKEN201703270303_FILE
02: 23
STDERR:
SUCCESS expected_to be_empty
(no output)
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/002-together-stdout-first (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `M>&N`, that means `redirect M to where N is redirected`.
In this test the standard output is specified first.
Before test:
01: rm -f new_file_stderr_and_stdout
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 1>new_file_stderr_and_stdout 2>&1
STDOUT:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
MISC:
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
SUCCESS expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/003-together-stderr-first (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `M>&N`, that means `redirect M to where N is redirected`.
In this test the standard error is specified first.
Before test:
01: rm -f new_file_stderr_and_stdout
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 2>new_file_stderr_and_stdout 1>&2
STDOUT:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
(no output)
MISC:
SUCCESS expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/004-together (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.
Before test:
01: rm -f "new_file_stderr_and_stdout"
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 &>new_file_stderr_and_stdout
STDOUT:
FAILURE expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_1
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
FAILURE expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_2
MISC:
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/redirections/outputs/truncating/multiple/005-together-with-whitespaces (FAILED)
Description:
A right redirection can be associated to the twice outputs by using `&>...`, that means `redirect stdout and stderr to ...`.
In this test, we specify the file name in a separate field.
Before test:
01: rm -f new_file_stderr_and_stdout
STDIN:
01: ./write_on_stdout_and_stderr TOKEN201703270303_1 TOKEN201703270303_2 &> new_file_stderr_and_stdout
STDOUT:
FAILURE expected_to_not match_regex `TOKEN201703270303_1`
SUCCESS expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_1
STDERR:
SUCCESS expected_to_not match_regex `TOKEN201703270303_1`
FAILURE expected_to_not match_regex `TOKEN201703270303_2`
01: TOKEN201703270303_2
MISC:
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_1$`
FAILURE expected_to create_file `new_file_stderr_and_stdout` matching_regex `TOKEN201703270303_2$`
----------------------------------------------------------------
21sh/separators/semicolon/003-parse-error-empty-inline-command (FAILED)
Description:
The purpose of this test is to check that using the simicolon separator `;` with empty commands results in error.
STDIN:
01: ./write_on_stdout TOKEN201703270303 ; ; ./exit_with_status 42
STDOUT:
SUCCESS expected_to be_empty
(no output)
STDERR:
SUCCESS expected_to_not be_empty
SUCCESS might match_regex `([Ss]yntax|[Pp]arse) error`
01: syntax error near unexpected token `;'
MISC:
SUCCESS expected_to_not exit_with_status `42`
FAILURE expected_to_not exit_with_status `0`
Total tests: 36
Total failed tests: 6
Total pending tests: 0