diff --git a/parser/Parser_test.go b/parser/Parser_test.go index 0f9d4e2..30f5a2a 100644 --- a/parser/Parser_test.go +++ b/parser/Parser_test.go @@ -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() }