Skip to content

Commit

Permalink
added unit test for the new selector implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarten committed Oct 2, 2024
1 parent 98e9634 commit ce67ecc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions parser/Parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,23 @@ func TestParser_ParseSelector(t *testing.T) {
}
ok = false

// selector with a function call
resetWithTokens(&par, lexer.Lexer("test.test()"))
par.MultiStep(2)
par.ParseSelector(nil)
if ok {
t.Errorf("ParseSelector() raised an error when it should not")
}
ok = false
// selector used in a binary expression
resetWithTokens(&par, lexer.Lexer("test.test + 1"))
par.MultiStep(2)
par.ParseSelector(nil)
if ok {
t.Errorf("ParseSelector() raised an error when it should not")
}
ok = false

e.RestoreExit()
}

Expand Down

0 comments on commit ce67ecc

Please sign in to comment.