X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c900f416c36cd74675c5bf4c33ad1dbe5d1e78fa..b30dca66a056bc6ee627bab5956dd8884a0e74aa:/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) + } +}