From e7df554dbae4f3ddbe1dff1142d632948fd251e7 Mon Sep 17 00:00:00 2001 From: Manuel Kieweg <mail@manuelkieweg.de> Date: Mon, 8 Mar 2021 19:03:36 +0000 Subject: [PATCH] gracefully end Subscribe()-Test --- nucleus/southbound_test.go | 3 ++- nucleus/store_test.go | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/nucleus/southbound_test.go b/nucleus/southbound_test.go index 8063b8120..ccd0d298a 100644 --- a/nucleus/southbound_test.go +++ b/nucleus/southbound_test.go @@ -114,7 +114,8 @@ func TestOpenConfig_Schema(t *testing.T) { schema: tt.fields.schema, id: tt.fields.id, } - if got := oc.Schema(); !reflect.DeepEqual(got, tt.want) { + got := oc.Schema().SchemaTree + if !reflect.DeepEqual(got, tt.want.SchemaTree) { t.Errorf("Schema() = %v, want %v", got, tt.want) } }) diff --git a/nucleus/store_test.go b/nucleus/store_test.go index 8a393efd6..8a5f50509 100644 --- a/nucleus/store_test.go +++ b/nucleus/store_test.go @@ -5,6 +5,7 @@ import ( "github.com/google/uuid" log "github.com/sirupsen/logrus" "reflect" + "sort" "testing" ) @@ -221,7 +222,14 @@ func Test_store_UUIDs(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := tt.s.UUIDs(); !reflect.DeepEqual(got, tt.want) { + sort.Slice(tt.want, func(i, j int) bool { + return tt.want[i].String() < tt.want[j].String() + }) + got := tt.s.UUIDs() + sort.Slice(got, func(i, j int) bool { + return got[i].String() < got[j].String() + }) + if !reflect.DeepEqual(got, tt.want) { t.Errorf("UUIDs() = %v, want %v", got, tt.want) } }) -- GitLab