Parser tests are now arf files

This commit is contained in:
Sasha Koshka 2022-08-12 10:26:16 -05:00
parent 81b47f7734
commit c09c9860b8
5 changed files with 8 additions and 4 deletions

View File

@ -47,7 +47,7 @@ func checkTokenSlice (filePath string, correct []Token, test *testing.T) {
}
func TestTokenizeAll (test *testing.T) {
checkTokenSlice("../tests/lexer/all", []Token {
checkTokenSlice("../tests/lexer/all.arf", []Token {
Token { kind: TokenKindSeparator },
Token { kind: TokenKindPermission, value: types.Permission {
Internal: types.ModeRead,
@ -90,7 +90,7 @@ func TestTokenizeAll (test *testing.T) {
}
func TestTokenizeNumbers (test *testing.T) {
checkTokenSlice("../tests/lexer/numbers", []Token {
checkTokenSlice("../tests/lexer/numbers.arf", []Token {
Token { kind: TokenKindUInt, value: uint64(83628266) },
Token { kind: TokenKindNewline },
Token { kind: TokenKindUInt, value: uint64(83628266) },
@ -119,7 +119,7 @@ func TestTokenizeNumbers (test *testing.T) {
}
func TestTokenizeText (test *testing.T) {
checkTokenSlice("../tests/lexer/text", []Token {
checkTokenSlice("../tests/lexer/text.arf", []Token {
Token { kind: TokenKindString, value: "hello world!\a\b\f\n\r\t\v'\"\\" },
Token { kind: TokenKindNewline },
Token { kind: TokenKindRune, value: '\a' },
@ -139,7 +139,7 @@ func TestTokenizeText (test *testing.T) {
}
func TestTokenizeIndent (test *testing.T) {
checkTokenSlice("../tests/lexer/indent", []Token {
checkTokenSlice("../tests/lexer/indent.arf", []Token {
Token { kind: TokenKindName, value: "line1" },
Token { kind: TokenKindNewline },
Token { kind: TokenKindIndent, value: 1 },

View File

@ -1,2 +1,3 @@
:arf
--- rw -> -349820394 932748397 239485.37520 "hello world!\n" 'E' helloWorld:.[]{}
+ - ++ -- * / @ ! % ~ < << > >> | || & &&

View File

@ -1,3 +1,4 @@
:arf
line1
line2
line3

View File

@ -1,3 +1,4 @@
:arf
83628266
0b100111111000001000011101010
0x4Fc10Ea

View File

@ -1,3 +1,4 @@
:arf
"hello world!\a\b\f\n\r\t\v\'\"\\"
'\a' '\b' '\f' '\n' '\r' '\t' '\v' '\'' '\"' '\\'
"hello world \x40\u0040\U00000040!"