Skip to content

Commit

Permalink
Update test expected results
Browse files Browse the repository at this point in the history
  • Loading branch information
trzysiek committed Dec 28, 2024
1 parent 3f506cd commit 3394ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
16 changes: 0 additions & 16 deletions quesma/model/expr_string_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@ func (v *renderer) VisitLiteral(l LiteralExpr) interface{} {
}
}

func (v *renderer) VisitTuple(t TupleExpr) interface{} {
switch len(t.Exprs) {
case 0:
logger.WarnWithThrottling("VisitTuple", "TupleExpr with no expressions")
return "()"
case 1:
return t.Exprs[0].Accept(v)
default:
args := make([]string, len(t.Exprs))
for i, arg := range t.Exprs {
args[i] = arg.Accept(v).(string)
}
return fmt.Sprintf("(%s)", strings.Join(args, ","))
}
}

func (v *renderer) VisitTuple(t TupleExpr) interface{} {
switch len(t.Exprs) {
case 0:
Expand Down
8 changes: 4 additions & 4 deletions quesma/testdata/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,10 +1014,10 @@ var TestsSearch = []SearchTestCase{
},
"track_total_hits": true
}`,
[]string{`("type"='task' AND "task.enabled" IN (true,54,'abc','abc\'s'))`},
[]string{`("type"='task' AND "task.enabled" IN tuple(true, 54, 'abc', 'abc\'s'))`},
model.ListAllFields,
[]string{
`SELECT "message" FROM ` + TableName + ` WHERE ("type"='task' AND "task.enabled" IN (true,54,'abc','abc\\'s')) LIMIT 10`,
`SELECT "message" FROM ` + TableName + ` WHERE ("type"='task' AND "task.enabled" IN tuple(true, 54, 'abc', 'abc\\'s')) LIMIT 10`,
`SELECT count(*) AS "column_0" FROM ` + TableName,
},
[]string{},
Expand Down Expand Up @@ -2196,13 +2196,13 @@ var TestsSearch = []SearchTestCase{
},
"track_total_hits": false
}`,
[]string{`("cliIP" IN ('2601:204:c503:c240:9c41:5531:ad94:4d90','50.116.43.98','75.246.0.64') AND ("@timestamp">=fromUnixTimestamp64Milli(1715817600000) AND "@timestamp"<=fromUnixTimestamp64Milli(1715990399000)))`},
[]string{`("cliIP" IN tuple('2601:204:c503:c240:9c41:5531:ad94:4d90', '50.116.43.98', '75.246.0.64') AND ("@timestamp">=fromUnixTimestamp64Milli(1715817600000) AND "@timestamp"<=fromUnixTimestamp64Milli(1715990399000)))`},
model.ListAllFields,
//[]model.Query{withLimit(justSimplestWhere(`("cliIP" IN ('2601:204:c503:c240:9c41:5531:ad94:4d90','50.116.43.98','75.246.0.64') AND ("@timestamp">=parseDateTime64BestEffort('2024-05-16T00:00:00') AND "@timestamp"<=parseDateTime64BestEffort('2024-05-17T23:59:59')))`), 1)},
[]string{
`SELECT "message" ` +
`FROM ` + TableName + ` ` +
`WHERE ("cliIP" IN ('2601:204:c503:c240:9c41:5531:ad94:4d90','50.116.43.98','75.246.0.64') ` +
`WHERE ("cliIP" IN tuple('2601:204:c503:c240:9c41:5531:ad94:4d90', '50.116.43.98', '75.246.0.64') ` +
`AND ("@timestamp">=fromUnixTimestamp64Milli(1715817600000) AND "@timestamp"<=fromUnixTimestamp64Milli(1715990399000))) ` +
`LIMIT 1`,
},
Expand Down

0 comments on commit 3394ec5

Please sign in to comment.