tpl/collections: Add some empty slice tests to intersect
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 8 Jul 2017 08:34:42 +0000 (10:34 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 8 Jul 2017 08:34:42 +0000 (10:34 +0200)
See #3686

tpl/collections/collections_test.go

index 239affad15692cf6f46d69bdd2c7e11f0c8c0e6c..c82d3c3bb3fb1fe01a71ee507db37afe9a9c2915 100644 (file)
@@ -344,6 +344,10 @@ func TestIntersect(t *testing.T) {
                {pagesVals{p1v, p4v, p2v, p3v}, pagesVals{p1v, p3v, p3v}, pagesVals{p1v, p3v}},
                {[]interface{}{p1, p4, p2, p3}, []interface{}{p4, p2, p2}, []interface{}{p4, p2}},
                {[]interface{}{p1v, p4v, p2v, p3v}, []interface{}{p1v, p3v, p3v}, []interface{}{p1v, p3v}},
+               {pagesPtr{p1, p4, p2, p3}, pagesPtr{}, pagesPtr{}},
+               {pagesVals{}, pagesVals{p1v, p3v, p3v}, pagesVals{}},
+               {[]interface{}{p1, p4, p2, p3}, []interface{}{}, []interface{}{}},
+               {[]interface{}{}, []interface{}{p1v, p3v, p3v}, []interface{}{}},
        } {
 
                errMsg := fmt.Sprintf("[%d]", test)