mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 11:57:51 +00:00
add new test to account for int64 nth values
This commit is contained in:
parent
8746444cdb
commit
87412068f1
1 changed files with 11 additions and 2 deletions
|
|
@ -7127,9 +7127,9 @@ func variousQueriesOnPercentiles(t *testing.T, c *test.Cluster) {
|
|||
}
|
||||
|
||||
// generate test cases per each nth argument
|
||||
nths := []float64{0.0, 10, 25, 50, 75, 90, 99}
|
||||
nthsFloat := []float64{0, 10, 25, 50, 75, 90, 99}
|
||||
var tests []testCase
|
||||
for _, nth := range nths {
|
||||
for _, nth := range nthsFloat {
|
||||
query := fmt.Sprintf(`Percentile(field="net_worth", filter=Row(val="foo"), nth=%f)`, nth)
|
||||
expectedPercentile := getExpectedPercentile(nums, nth)
|
||||
tests = append(tests, testCase{
|
||||
|
|
@ -7137,6 +7137,15 @@ func variousQueriesOnPercentiles(t *testing.T, c *test.Cluster) {
|
|||
csvVerifier: fmt.Sprintf("%d,1\n", expectedPercentile),
|
||||
})
|
||||
}
|
||||
nthsInt := []int64{0, 10, 25, 50, 75, 90, 99}
|
||||
for _, nth := range nthsInt {
|
||||
query := fmt.Sprintf(`Percentile(field="net_worth", filter=Row(val="foo"), nth=%d)`, nth)
|
||||
expectedPercentile := getExpectedPercentile(nums, float64(nth))
|
||||
tests = append(tests, testCase{
|
||||
query: query,
|
||||
csvVerifier: fmt.Sprintf("%d,1\n", expectedPercentile),
|
||||
})
|
||||
}
|
||||
|
||||
for i, tst := range tests {
|
||||
t.Run(fmt.Sprintf("%d-%s", i, tst.query), func(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue