Improve code quality
This commit is contained in:
parent
5edad332cd
commit
3f260e7ffd
11 changed files with 95 additions and 45 deletions
|
|
@ -182,14 +182,14 @@ func TestNewLexer(t *testing.T) {
|
|||
|
||||
// lexer NextToken provides an error when it comes across an invalid token
|
||||
func TestLexer_NextTokenErrors(t *testing.T) {
|
||||
invalid_codes := []string{
|
||||
invalidCodes := []string{
|
||||
// Invalid tokens
|
||||
"^", "@", "$&", "¨",
|
||||
// Non-ending string (in same line)
|
||||
"\"", "Hini minit \"mini moe", "\"this is some test\ncontent\"", "\n\"Hello world",
|
||||
}
|
||||
|
||||
for _, code := range invalid_codes {
|
||||
for _, code := range invalidCodes {
|
||||
lex := NewLexer(code)
|
||||
tok, err := lex.NextToken()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue