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:
@ -0,0 +1,6 @@
|
||||
---input---
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
|
||||
---tokens---
|
||||
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' Text
|
||||
'\n' Text.Whitespace
|
54
spec/unsupported_lexers/elpi/test_chr.txt
Normal file
54
spec/unsupported_lexers/elpi/test_chr.txt
Normal file
@ -0,0 +1,54 @@
|
||||
---input---
|
||||
constraint foo, bar {
|
||||
|
||||
:name "myrule"
|
||||
rule (odd X) \ (even X) | true <=> fail.
|
||||
|
||||
}
|
||||
rule. % not a kwd
|
||||
|
||||
---tokens---
|
||||
'constraint' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'foo, bar ' Name.Function
|
||||
'{' Text
|
||||
'\n\n ' Text.Whitespace
|
||||
':name' Keyword.Mode
|
||||
' ' Text.Whitespace
|
||||
'"' Literal.String.Double
|
||||
'myrule' Literal.String.Double
|
||||
'"' Literal.String.Double
|
||||
'\n ' Text.Whitespace
|
||||
'rule' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'(' Text
|
||||
'odd' Text
|
||||
' ' Text.Whitespace
|
||||
'X' Name.Variable
|
||||
')' Operator
|
||||
' ' Text.Whitespace
|
||||
'\\' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'(' Text
|
||||
'even' Text
|
||||
' ' Text.Whitespace
|
||||
'X' Name.Variable
|
||||
')' Operator
|
||||
' ' Text.Whitespace
|
||||
'|' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'true' Text
|
||||
' ' Text.Whitespace
|
||||
'<=>' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'fail' Text
|
||||
'.' Operator
|
||||
'\n\n' Text.Whitespace
|
||||
|
||||
'}' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'rule' Text
|
||||
'.' Operator
|
||||
' ' Text.Whitespace
|
||||
'% not a kwd\n' Comment
|
67
spec/unsupported_lexers/elpi/test_clause.txt
Normal file
67
spec/unsupported_lexers/elpi/test_clause.txt
Normal file
@ -0,0 +1,67 @@
|
||||
---input---
|
||||
true.
|
||||
stop :- !.
|
||||
of (fun F) :- pi x\ of x => of (F x).
|
||||
match (uvar as Y) :- print Y.
|
||||
|
||||
---tokens---
|
||||
'true' Text
|
||||
'.' Operator
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'stop' Text
|
||||
' ' Text.Whitespace
|
||||
':-' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'!' Keyword.Declaration
|
||||
'.' Operator
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'of' Text
|
||||
' ' Text.Whitespace
|
||||
'(' Text
|
||||
'fun' Text
|
||||
' ' Text.Whitespace
|
||||
'F' Name.Variable
|
||||
')' Operator
|
||||
' ' Text.Whitespace
|
||||
':-' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'pi' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'x' Name.Variable
|
||||
'\\' Text
|
||||
' ' Text.Whitespace
|
||||
'of' Text
|
||||
' ' Text.Whitespace
|
||||
'x' Text
|
||||
' ' Text.Whitespace
|
||||
'=>' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'of' Text
|
||||
' ' Text.Whitespace
|
||||
'(' Text
|
||||
'F' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'x' Text
|
||||
')' Operator
|
||||
'.' Operator
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'match' Text
|
||||
' ' Text.Whitespace
|
||||
'(' Text
|
||||
'uvar' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'as' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'Y' Name.Variable
|
||||
')' Operator
|
||||
' ' Text.Whitespace
|
||||
':-' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'print' Text
|
||||
' ' Text.Whitespace
|
||||
'Y' Name.Variable
|
||||
'.' Operator
|
||||
'\n' Text.Whitespace
|
35
spec/unsupported_lexers/elpi/test_namespace.txt
Normal file
35
spec/unsupported_lexers/elpi/test_namespace.txt
Normal file
@ -0,0 +1,35 @@
|
||||
---input---
|
||||
namespace foo.bar {
|
||||
baz :- std.do! [].
|
||||
}
|
||||
shorten foo. { bar }.
|
||||
|
||||
---tokens---
|
||||
'namespace' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'foo.bar' Text
|
||||
' ' Text.Whitespace
|
||||
'{\n' Text
|
||||
|
||||
' ' Text.Whitespace
|
||||
'baz' Text
|
||||
' ' Text.Whitespace
|
||||
':-' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'std.do!' Text
|
||||
' ' Text.Whitespace
|
||||
'[]' Keyword.Declaration
|
||||
'.' Operator
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}\n' Text
|
||||
|
||||
'shorten' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'foo.' Text
|
||||
' ' Text.Whitespace
|
||||
'{ ' Text
|
||||
'bar' Text
|
||||
' ' Text.Whitespace
|
||||
'}.' Text
|
||||
'\n' Text.Whitespace
|
60
spec/unsupported_lexers/elpi/test_pred.txt
Normal file
60
spec/unsupported_lexers/elpi/test_pred.txt
Normal file
@ -0,0 +1,60 @@
|
||||
---input---
|
||||
pred p1.
|
||||
pred p2 i:int, o:list A.
|
||||
pred p3 i:(bool -> prop).
|
||||
:index(_ 2) pred p4 i:int, i:A.
|
||||
|
||||
---tokens---
|
||||
'pred' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'p1' Name.Function
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'pred' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'p2' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'i:' Keyword.Mode
|
||||
'int' Keyword.Type
|
||||
',' Text
|
||||
' ' Text.Whitespace
|
||||
'o:' Keyword.Mode
|
||||
'list' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'A' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'pred' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'p3' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'i:' Keyword.Mode
|
||||
'(' Keyword.Type
|
||||
'bool' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'prop' Keyword.Type
|
||||
')' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
':index' Keyword.Mode
|
||||
'(' Text.Whitespace
|
||||
'_ 2' Literal.Number.Integer
|
||||
')' Text
|
||||
' ' Text.Whitespace
|
||||
'pred' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'p4' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'i:' Keyword.Mode
|
||||
'int' Keyword.Type
|
||||
',' Text
|
||||
' ' Text.Whitespace
|
||||
'i:' Keyword.Mode
|
||||
'A' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
33
spec/unsupported_lexers/elpi/test_quotations.txt
Normal file
33
spec/unsupported_lexers/elpi/test_quotations.txt
Normal file
@ -0,0 +1,33 @@
|
||||
---input---
|
||||
tc {{ Eq lp:A }} {{ f lp:B l } }} :- foo A B.
|
||||
|
||||
---tokens---
|
||||
'tc' Text
|
||||
' ' Text.Whitespace
|
||||
'{{' Punctuation
|
||||
' Eq ' Text
|
||||
'lp:' Keyword
|
||||
'A' Name.Variable
|
||||
' ' Text
|
||||
'}}' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'{{' Punctuation
|
||||
' f ' Text
|
||||
'lp:' Keyword
|
||||
'B' Name.Variable
|
||||
' ' Text
|
||||
'l' Text
|
||||
' ' Text
|
||||
'}' Text
|
||||
' ' Text
|
||||
'}}' Punctuation
|
||||
' ' Text.Whitespace
|
||||
':-' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'foo' Text
|
||||
' ' Text.Whitespace
|
||||
'A' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'B' Name.Variable
|
||||
'.' Operator
|
||||
'\n' Text.Whitespace
|
112
spec/unsupported_lexers/elpi/test_type.txt
Normal file
112
spec/unsupported_lexers/elpi/test_type.txt
Normal file
@ -0,0 +1,112 @@
|
||||
---input---
|
||||
kind list type -> type.
|
||||
type nil list A.
|
||||
type cons A -> list A -> list A.
|
||||
kind tm type.
|
||||
type fun (tm -> tm) -> tm.
|
||||
type app tm -> tm -> tm.
|
||||
pred foo i:(tm -> tm), o:tm.
|
||||
|
||||
---tokens---
|
||||
'kind' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'list' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'type' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'type' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'type' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'nil' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'list' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'A' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'type' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'cons' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'A' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'list' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'A' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'list' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'A' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'kind' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'tm' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'type' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'type' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'fun' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'(' Keyword.Type
|
||||
'tm' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'tm' Keyword.Type
|
||||
')' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'tm' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'type' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'app' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'tm' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'tm' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'tm' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'pred' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'foo' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'i:' Keyword.Mode
|
||||
'(' Keyword.Type
|
||||
'tm' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'->' Keyword.Type
|
||||
' ' Text.Whitespace
|
||||
'tm' Keyword.Type
|
||||
')' Keyword.Type
|
||||
',' Text
|
||||
' ' Text.Whitespace
|
||||
'o:' Keyword.Mode
|
||||
'tm' Keyword.Type
|
||||
'.' Text
|
||||
'\n' Text.Whitespace
|
Reference in New Issue
Block a user