X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a95f899d7ac84f29b3d019aa410d265bb40833e5..4a30eb19ec37e84947f49f2d39b1acae3ebf3847:/sdk/go/arvados/resource_list_test.go diff --git a/sdk/go/arvados/resource_list_test.go b/sdk/go/arvados/resource_list_test.go index b5e6e7da47..4e09c5375d 100644 --- a/sdk/go/arvados/resource_list_test.go +++ b/sdk/go/arvados/resource_list_test.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + package arvados import ( @@ -19,3 +23,14 @@ func TestMarshalFiltersWithNanoseconds(t *testing.T) { t.Errorf("Encoded as %q, expected %q", buf, expect) } } + +func TestMarshalFiltersWithNil(t *testing.T) { + buf, err := json.Marshal([]Filter{ + {Attr: "modified_at", Operator: "=", Operand: nil}}) + if err != nil { + t.Fatal(err) + } + if expect := []byte(`[["modified_at","=",null]]`); 0 != bytes.Compare(buf, expect) { + t.Errorf("Encoded as %q, expected %q", buf, expect) + } +}