mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
Fix flaky test
This commit is contained in:
+2
-2
@@ -178,7 +178,7 @@ func Benchmark_filterMap(b *testing.B) {
|
||||
Ints []int
|
||||
}
|
||||
env := Env{
|
||||
Ints: make([]int, 1000),
|
||||
Ints: make([]int, 100),
|
||||
}
|
||||
for i := 1; i <= len(env.Ints); i++ {
|
||||
env.Ints[i-1] = i
|
||||
@@ -195,7 +195,7 @@ func Benchmark_filterMap(b *testing.B) {
|
||||
b.StopTimer()
|
||||
|
||||
require.NoError(b, err)
|
||||
require.Len(b, out.([]interface{}), 142)
|
||||
require.Len(b, out.([]interface{}), 14)
|
||||
require.Equal(b, 14, out.([]interface{})[0])
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestBuiltin(t *testing.T) {
|
||||
{`fromJSON("[1, 2, 3]")`, []interface{}{1.0, 2.0, 3.0}},
|
||||
{`toBase64("hello")`, "aGVsbG8="},
|
||||
{`fromBase64("aGVsbG8=")`, "hello"},
|
||||
{`now().Format("2006-01-02T15:04:05Z")`, time.Now().Format("2006-01-02T15:04:05Z")},
|
||||
{`now().Format("2006-01-02T15:04Z")`, time.Now().Format("2006-01-02T15:04Z")},
|
||||
{`duration("1h")`, time.Hour},
|
||||
{`date("2006-01-02T15:04:05Z")`, time.Date(2006, 1, 2, 15, 4, 5, 0, time.UTC)},
|
||||
{`date("2006.01.02", "2006.01.02")`, time.Date(2006, 1, 2, 0, 0, 0, 0, time.UTC)},
|
||||
|
||||
Reference in New Issue
Block a user