mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 06:33:06 -03:00
Reorganize tests into a real spec suite
This commit is contained in:
14
spec/tests/bash_session/fake_ps2_prompt.txt
Normal file
14
spec/tests/bash_session/fake_ps2_prompt.txt
Normal file
@ -0,0 +1,14 @@
|
||||
# Test that missing backslash means it's no prompt.
|
||||
|
||||
---input---
|
||||
$ echo "> not a prompt"
|
||||
> not a prompt
|
||||
|
||||
---tokens---
|
||||
'$ ' Generic.Prompt
|
||||
'echo' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'"> not a prompt"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'> not a prompt\n' Generic.Output
|
21
spec/tests/bash_session/prompt_in_output.txt
Normal file
21
spec/tests/bash_session/prompt_in_output.txt
Normal file
@ -0,0 +1,21 @@
|
||||
# Test that output that looks like a prompt is not detected as such.
|
||||
|
||||
---input---
|
||||
$ cat \
|
||||
> test.txt
|
||||
line1
|
||||
> file content, not prompt!
|
||||
|
||||
---tokens---
|
||||
'$ ' Generic.Prompt
|
||||
'cat' Text
|
||||
' ' Text.Whitespace
|
||||
'\\\n' Literal.String.Escape
|
||||
|
||||
'> ' Generic.Prompt
|
||||
'test.txt' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'line1\n' Generic.Output
|
||||
|
||||
'> file content, not prompt!\n' Generic.Output
|
15
spec/tests/bash_session/ps2_prompt.txt
Normal file
15
spec/tests/bash_session/ps2_prompt.txt
Normal file
@ -0,0 +1,15 @@
|
||||
---input---
|
||||
$ ls\
|
||||
> /does/not/exist
|
||||
ls: cannot access ...
|
||||
|
||||
---tokens---
|
||||
'$ ' Generic.Prompt
|
||||
'ls' Text
|
||||
'\\\n' Literal.String.Escape
|
||||
|
||||
'> ' Generic.Prompt
|
||||
'/does/not/exist' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'ls: cannot access ...\n' Generic.Output
|
6
spec/tests/bash_session/test_comment_after_prompt.txt
Normal file
6
spec/tests/bash_session/test_comment_after_prompt.txt
Normal file
@ -0,0 +1,6 @@
|
||||
---input---
|
||||
$# comment
|
||||
|
||||
---tokens---
|
||||
'$' Generic.Prompt
|
||||
'# comment\n' Comment.Single
|
16
spec/tests/bash_session/test_newline_in_echo_no_ps2.txt
Normal file
16
spec/tests/bash_session/test_newline_in_echo_no_ps2.txt
Normal file
@ -0,0 +1,16 @@
|
||||
---input---
|
||||
$ echo \
|
||||
hi
|
||||
hi
|
||||
|
||||
---tokens---
|
||||
'$ ' Generic.Prompt
|
||||
'echo' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'\\\n' Literal.String.Escape
|
||||
|
||||
' ' Text.Whitespace
|
||||
'hi' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'hi\n' Generic.Output
|
16
spec/tests/bash_session/test_newline_in_echo_ps2.txt
Normal file
16
spec/tests/bash_session/test_newline_in_echo_ps2.txt
Normal file
@ -0,0 +1,16 @@
|
||||
---input---
|
||||
$ echo \
|
||||
> hi
|
||||
hi
|
||||
|
||||
---tokens---
|
||||
'$ ' Generic.Prompt
|
||||
'echo' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'\\\n' Literal.String.Escape
|
||||
|
||||
'> ' Generic.Prompt
|
||||
'hi' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'hi\n' Generic.Output
|
16
spec/tests/bash_session/test_newline_in_ls_no_ps2.txt
Normal file
16
spec/tests/bash_session/test_newline_in_ls_no_ps2.txt
Normal file
@ -0,0 +1,16 @@
|
||||
---input---
|
||||
$ ls \
|
||||
hi
|
||||
hi
|
||||
|
||||
---tokens---
|
||||
'$ ' Generic.Prompt
|
||||
'ls' Text
|
||||
' ' Text.Whitespace
|
||||
'\\\n' Literal.String.Escape
|
||||
|
||||
' ' Text.Whitespace
|
||||
'hi' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'hi\n' Generic.Output
|
16
spec/tests/bash_session/test_newline_in_ls_ps2.txt
Normal file
16
spec/tests/bash_session/test_newline_in_ls_ps2.txt
Normal file
@ -0,0 +1,16 @@
|
||||
---input---
|
||||
$ ls \
|
||||
> hi
|
||||
hi
|
||||
|
||||
---tokens---
|
||||
'$ ' Generic.Prompt
|
||||
'ls' Text
|
||||
' ' Text.Whitespace
|
||||
'\\\n' Literal.String.Escape
|
||||
|
||||
'> ' Generic.Prompt
|
||||
'hi' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'hi\n' Generic.Output
|
11
spec/tests/bash_session/test_virtualenv.txt
Normal file
11
spec/tests/bash_session/test_virtualenv.txt
Normal file
@ -0,0 +1,11 @@
|
||||
---input---
|
||||
(env) [~/project]$ foo -h
|
||||
|
||||
---tokens---
|
||||
'(env)' Generic.Prompt.VirtualEnv
|
||||
' ' Text
|
||||
'[~/project]$ ' Generic.Prompt
|
||||
'foo' Text
|
||||
' ' Text.Whitespace
|
||||
'-h' Text
|
||||
'\n' Text.Whitespace
|
Reference in New Issue
Block a user