Skip to content

Commit

Permalink
refactor: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
whoAbhishekSah committed Feb 17, 2025
1 parent 41d3b8f commit 317964b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rql/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ func TestValidateQuery(t *testing.T) {
name: "Valid filters and sort",
query: Query{
Filters: []Filter{
{Name: "ID", Operator: "eq", Type: "number", Value: 123},
{Name: "Name", Operator: "like", Type: "string", Value: "test"},
{Name: "IsActive", Operator: "eq", Type: "bool", Value: true},
{Name: "CreatedAt", Operator: "eq", Type: "datetime", Value: "2021-09-15T15:53:00Z"},
{Name: "ID", Operator: "eq", Value: 123},
{Name: "Name", Operator: "like", Value: "test"},
{Name: "IsActive", Operator: "eq", Value: true},
{Name: "CreatedAt", Operator: "eq", Value: "2021-09-15T15:53:00Z"},
},
Sort: []Sort{
{Key: "ID", Order: "asc"},
Expand All @@ -39,7 +39,7 @@ func TestValidateQuery(t *testing.T) {
name: "Invalid filter key",
query: Query{
Filters: []Filter{
{Name: "NonExistentKey", Operator: "eq", Type: "string", Value: "test"},
{Name: "NonExistentKey", Operator: "eq", Value: "test"},
},
},
checkStruct: TestStruct{},
Expand All @@ -49,7 +49,7 @@ func TestValidateQuery(t *testing.T) {
name: "Invalid filter operator",
query: Query{
Filters: []Filter{
{Name: "ID", Operator: "invalid", Type: "number", Value: 123},
{Name: "ID", Operator: "invalid", Value: 123},
},
},
checkStruct: TestStruct{},
Expand All @@ -59,7 +59,7 @@ func TestValidateQuery(t *testing.T) {
name: "Invalid filter value type",
query: Query{
Filters: []Filter{
{Name: "ID", Operator: "eq", Type: "number", Value: "invalid"},
{Name: "ID", Operator: "eq", Value: "invalid"},
},
},
checkStruct: TestStruct{},
Expand Down

0 comments on commit 317964b

Please sign in to comment.