[#255] v2/object: Implement json.Marshaler/Unmarshaler on SearchFilter

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-10 01:31:50 +03:00 committed by Alex Vanin
parent ebff07aaf2
commit f9939e8c90
2 changed files with 32 additions and 0 deletions

View file

@ -78,3 +78,15 @@ func TestObjectJSON(t *testing.T) {
require.Equal(t, o, o2)
}
func TestSearchFilterJSON(t *testing.T) {
f := generateFilter("key", "value")
data, err := f.MarshalJSON()
require.NoError(t, err)
f2 := new(object.SearchFilter)
require.NoError(t, f2.UnmarshalJSON(data))
require.Equal(t, f, f2)
}