Reorganize tests into a real spec suite

This commit is contained in:
2024-08-04 19:18:43 -03:00
parent 57c160173c
commit e7c2053222
693 changed files with 136 additions and 116 deletions

View 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

View 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

View 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

View File

@ -0,0 +1,6 @@
---input---
$# comment
---tokens---
'$' Generic.Prompt
'# comment\n' Comment.Single

View 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

View 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

View 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

View 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

View 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