From 4e2ef6a30a9ba037a28c7573c0c420c70ded8690 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 8 Jun 2021 15:06:53 +0300 Subject: [PATCH] [#293] pkg/eacl: Fix table encoding test with a temporary solution Signed-off-by: Leonard Lyubich --- pkg/acl/eacl/table_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/acl/eacl/table_test.go b/pkg/acl/eacl/table_test.go index 06c7c7ab..6dcf062d 100644 --- a/pkg/acl/eacl/table_test.go +++ b/pkg/acl/eacl/table_test.go @@ -65,7 +65,7 @@ func TestTable_AddRecord(t *testing.T) { require.Equal(t, records, table.Records()) } -func TestRecordEncoding(t *testing.T) { +func TestTableEncoding(t *testing.T) { tab := eacltest.Table() t.Run("binary", func(t *testing.T) { @@ -75,17 +75,19 @@ func TestRecordEncoding(t *testing.T) { tab2 := eacl.NewTable() require.NoError(t, tab2.Unmarshal(data)) - require.Equal(t, tab, tab2) + // FIXME: we compare v2 messages because + // Filter contains fmt.Stringer interface + require.Equal(t, tab.ToV2(), tab2.ToV2()) }) t.Run("json", func(t *testing.T) { data, err := tab.MarshalJSON() require.NoError(t, err) - r2 := eacl.NewTable() - require.NoError(t, r2.UnmarshalJSON(data)) + tab2 := eacl.NewTable() + require.NoError(t, tab2.UnmarshalJSON(data)) - require.Equal(t, tab, r2) + require.Equal(t, tab.ToV2(), tab2.ToV2()) }) }