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,72 @@
---input---
super(member1, member2)
super(member1,member2)
super(member1,
member2)
super (member1, member2)
super (member1,member2)
super (member1,
member2)
---tokens---
'super' Keyword
'(' Punctuation
'member1' Name.Other
',' Punctuation
' ' Text.Whitespace
'member2' Name.Other
')' Punctuation
'\n\n' Text.Whitespace
'super' Keyword
'(' Punctuation
'member1' Name.Other
',' Punctuation
'member2' Name.Other
')' Punctuation
'\n\n' Text.Whitespace
'super' Keyword
'(' Punctuation
'member1' Name.Other
',' Punctuation
'\n' Text.Whitespace
'member2' Name.Other
')' Punctuation
'\n\n' Text.Whitespace
'super' Keyword
' ' Text.Whitespace
'(' Punctuation
'member1' Name.Other
',' Punctuation
' ' Text.Whitespace
'member2' Name.Other
')' Punctuation
'\n\n' Text.Whitespace
'super' Keyword
' ' Text.Whitespace
'(' Punctuation
'member1' Name.Other
',' Punctuation
'member2' Name.Other
')' Punctuation
'\n\n' Text.Whitespace
'super' Keyword
' ' Text.Whitespace
'(' Punctuation
'member1' Name.Other
',' Punctuation
'\n' Text.Whitespace
'member2' Name.Other
')' Punctuation
'\n' Text.Whitespace

View File

@ -0,0 +1,27 @@
---input---
// Test text that should **not** be tokenized as binary literals.
0b0N
0b
0bb
0b2
---tokens---
'' Text
'// Test text that should **not** be tokenized as binary literals.' Comment.Single
'\n' Text.Whitespace
'0b0' Literal.Number.Bin
'N' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'b' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'bb' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'b2' Name.Other
'\n' Text.Whitespace

View File

@ -0,0 +1,15 @@
---input---
// Test literals that should be tokenized as binary literals.
0b01
0B10n
---tokens---
'' Text
'// Test literals that should be tokenized as binary literals.' Comment.Single
'\n' Text.Whitespace
'0b01' Literal.Number.Bin
'\n' Text.Whitespace
'0B10n' Literal.Number.Bin
'\n' Text.Whitespace

View File

@ -0,0 +1,60 @@
---input---
// Test text that should **not** be tokenized as float literals.
.୪
.
1..
1n
1ee
1e
1e-
1e--1
1e++1
1e1.0
---tokens---
'' Text
'// Test text that should **not** be tokenized as float literals.' Comment.Single
'\n' Text.Whitespace
'.' Punctuation
'୪' Error
'\n' Text.Whitespace
'.' Punctuation
'\n' Text.Whitespace
'1.' Literal.Number.Float
'.' Punctuation
'\n' Text.Whitespace
'1n' Literal.Number.Integer
'\n' Text.Whitespace
'1' Literal.Number.Float
'ee' Name.Other
'\n' Text.Whitespace
'1' Literal.Number.Float
'e' Name.Other
'\n' Text.Whitespace
'1' Literal.Number.Float
'e' Name.Other
'-' Operator
'\n' Text.Whitespace
'1' Literal.Number.Float
'e' Name.Other
'--' Operator
'1' Literal.Number.Float
'\n' Text.Whitespace
'1' Literal.Number.Float
'e' Name.Other
'++' Operator
'1' Literal.Number.Float
'\n' Text.Whitespace
'1e1' Literal.Number.Float
'.0' Literal.Number.Float
'\n' Text.Whitespace

View File

@ -0,0 +1,52 @@
---input---
// Test literals that should be tokenized as float literals.
1
1.
.1
1.1
1e1
1E1
1e+1
1E-1
1.e1
1e1
0888 // octal prefix with non-octal numbers
---tokens---
'' Text
'// Test literals that should be tokenized as float literals.' Comment.Single
'\n' Text.Whitespace
'1' Literal.Number.Float
'\n' Text.Whitespace
'1.' Literal.Number.Float
'\n ' Text.Whitespace
'.1' Literal.Number.Float
'\n' Text.Whitespace
'1.1' Literal.Number.Float
'\n' Text.Whitespace
'1e1' Literal.Number.Float
'\n' Text.Whitespace
'1E1' Literal.Number.Float
'\n' Text.Whitespace
'1e+1' Literal.Number.Float
'\n' Text.Whitespace
'1E-1' Literal.Number.Float
'\n' Text.Whitespace
'1.e1' Literal.Number.Float
'\n' Text.Whitespace
'1e1' Literal.Number.Float
'\n' Text.Whitespace
'0888' Literal.Number.Float
' ' Text.Whitespace
'// octal prefix with non-octal numbers' Comment.Single
'\n' Text.Whitespace

View File

@ -0,0 +1,32 @@
---input---
// Test text that should **not** be tokenized as hexadecimal literals.
0x0N
0x
0Xx
0xg
0xhn
---tokens---
'' Text
'// Test text that should **not** be tokenized as hexadecimal literals.' Comment.Single
'\n' Text.Whitespace
'0x0' Literal.Number.Hex
'N' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'x' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'Xx' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'xg' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'xhn' Name.Other
'\n' Text.Whitespace

View File

@ -0,0 +1,19 @@
---input---
// Test literals that should be tokenized as hexadecimal literals.
0x01
0Xefn
0x0EF
---tokens---
'' Text
'// Test literals that should be tokenized as hexadecimal literals.' Comment.Single
'\n' Text.Whitespace
'0x01' Literal.Number.Hex
'\n' Text.Whitespace
'0Xefn' Literal.Number.Hex
'\n' Text.Whitespace
'0x0EF' Literal.Number.Hex
'\n' Text.Whitespace

View File

@ -0,0 +1,20 @@
---input---
// Test text that should **not** be tokenized as integer literals.
1N
1
1.0
---tokens---
'' Text
'// Test text that should **not** be tokenized as integer literals.' Comment.Single
'\n' Text.Whitespace
'1' Literal.Number.Float
'N' Name.Other
'\n' Text.Whitespace
'1' Literal.Number.Float
'\n' Text.Whitespace
'1.0' Literal.Number.Float
'\n' Text.Whitespace

View File

@ -0,0 +1,15 @@
---input---
// Test literals that should be tokenized as integer literals.
0n
123n
---tokens---
'' Text
'// Test literals that should be tokenized as integer literals.' Comment.Single
'\n' Text.Whitespace
'0n' Literal.Number.Integer
'\n' Text.Whitespace
'123n' Literal.Number.Integer
'\n' Text.Whitespace

View File

@ -0,0 +1,40 @@
---input---
// Test text that should **not** be tokenized as octal literals.
01N
089
098
0o
0OO
0o88
0O88n
---tokens---
'' Text
'// Test text that should **not** be tokenized as octal literals.' Comment.Single
'\n' Text.Whitespace
'01' Literal.Number.Oct
'N' Name.Other
'\n' Text.Whitespace
'089' Literal.Number.Float
'\n' Text.Whitespace
'098' Literal.Number.Float
'\n' Text.Whitespace
'0' Literal.Number.Float
'o' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'OO' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'o88' Name.Other
'\n' Text.Whitespace
'0' Literal.Number.Float
'O88n' Name.Other
'\n' Text.Whitespace

View File

@ -0,0 +1,23 @@
---input---
// Test literals that should be tokenized as octal literals.
017
071n
0o11
0O77n
---tokens---
'' Text
'// Test literals that should be tokenized as octal literals.' Comment.Single
'\n' Text.Whitespace
'017' Literal.Number.Oct
'\n' Text.Whitespace
'071n' Literal.Number.Oct
'\n' Text.Whitespace
'0o11' Literal.Number.Oct
'\n' Text.Whitespace
'0O77n' Literal.Number.Oct
'\n' Text.Whitespace