tpl/collections: Fix In function for JSON arrays

Fixes #1468
This commit is contained in:
Bjørn Erik Pedersen
2017-07-03 10:08:55 +02:00
parent e10e51a008
commit d12cf5a25d
4 changed files with 72 additions and 19 deletions

View File

@@ -244,10 +244,13 @@ func TestIn(t *testing.T) {
{[]int{1, 2, 4}, 3, false},
{[]float64{1.23, 2.45, 4.67}, 1.23, true},
{[]float64{1.234567, 2.45, 4.67}, 1.234568, false},
{[]float64{1, 2, 3}, 1, true},
{[]float32{1, 2, 3}, 1, true},
{"this substring should be found", "substring", true},
{"this substring should not be found", "subseastring", false},
{nil, "foo", false},
} {
errMsg := fmt.Sprintf("[%d] %v", i, test)
result := ns.In(test.l1, test.l2)