diff --git a/soql/parser/core/helpers.go b/soql/parser/core/helpers.go index 156f7c9..0a55646 100644 --- a/soql/parser/core/helpers.go +++ b/soql/parser/core/helpers.go @@ -1,6 +1,8 @@ package core import ( + "strings" + . "github.com/shellyln/takenoco/base" objparser "github.com/shellyln/takenoco/object" ) @@ -31,7 +33,7 @@ func makeOpMatcher(className string, ops []string) func(c interface{}) bool { } val := ast.Value.(string) for _, op := range ops { - if op == val { + if strings.EqualFold(op, val) { return true } } diff --git a/soql/parser/parser_test.go b/soql/parser/parser_test.go index d384e29..c02529d 100644 --- a/soql/parser/parser_test.go +++ b/soql/parser/parser_test.go @@ -91,6 +91,18 @@ func TestParse(t *testing.T) { want: nil, wantErr: false, dbgBreak: true, + }, { + name: "Fix bug (2025-01-08) #1", + args: args{s: `SELECT Id FROM Contact WHERE LastName = 'bar' or (Name = 'bar' and LastName = 'foo')`}, + want: nil, + wantErr: false, + dbgBreak: true, + }, { + name: "Fix bug (2025-01-08) #2", + args: args{s: `SELECT Id FROM Contact WHERE LastName = 'bar' OR (Name = 'bar' AND LastName = 'foo')`}, + want: nil, + wantErr: false, + dbgBreak: true, }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {