Created indent test

This commit is contained in:
Sasha Koshka 2022-08-11 12:47:50 -05:00
parent 71157122d6
commit 471eb863f4
2 changed files with 19 additions and 1 deletions

View File

@ -137,3 +137,21 @@ func TestTokenizeText (test *testing.T) {
Token { kind: TokenKindNewline },
}, test)
}
func TestTokenizeIndent (test *testing.T) {
checkTokenSlice("../tests/lexer/indent", []Token {
Token { kind: TokenKindName, value: "line1" },
Token { kind: TokenKindNewline },
Token { kind: TokenKindIndent, value: 1 },
Token { kind: TokenKindName, value: "line2" },
Token { kind: TokenKindNewline },
Token { kind: TokenKindIndent, value: 4 },
Token { kind: TokenKindName, value: "line3" },
Token { kind: TokenKindNewline },
Token { kind: TokenKindName, value: "line4" },
Token { kind: TokenKindNewline },
Token { kind: TokenKindIndent, value: 2 },
Token { kind: TokenKindName, value: "line5" },
Token { kind: TokenKindNewline },
}, test)
}

View File

@ -4,4 +4,4 @@ line1
line4
line5
line5