Skip to content

Commit

Permalink
addtional test to ensure things in lexer work
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jun 1, 2020
1 parent 54e0c61 commit 60deecf
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions processor/parser/lexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,37 @@ func TestNextTokenMultipleSomethingQuote(t *testing.T) {
t.Error(`expected PAREN_CLOSE got`, token.Type)
}
}

func TestNextTokenMultipleEverythingQuote(t *testing.T) {
lex := NewLexer(`("test") ("test")`)

token := lex.NextToken()
if token.Type != "PAREN_OPEN" {
t.Error(`expected PAREN_OPEN got`, token.Type)
}

token = lex.NextToken()
if token.Type != "QUOTED_TERM" {
t.Error(`expected QUOTED_TERM got`, token.Type)
}

token = lex.NextToken()
if token.Type != "PAREN_CLOSE" {
t.Error(`expected PAREN_CLOSE got`, token.Type)
}

token = lex.NextToken()
if token.Type != "PAREN_OPEN" {
t.Error(`expected PAREN_OPEN got`, token.Type)
}

token = lex.NextToken()
if token.Type != "QUOTED_TERM" {
t.Error(`expected QUOTED_TERM got`, token.Type)
}

token = lex.NextToken()
if token.Type != "PAREN_CLOSE" {
t.Error(`expected PAREN_CLOSE got`, token.Type)
}
}

0 comments on commit 60deecf

Please sign in to comment.