From 08ac73f8ae22fe1bd371016d32ddb5b5b9f453d2 Mon Sep 17 00:00:00 2001 From: Joern Barthel Date: Thu, 13 Jun 2024 11:49:35 +0200 Subject: [PATCH] fixed ordering issue in test --- ykoath_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ykoath_test.go b/ykoath_test.go index a8d4216..7324618 100644 --- a/ykoath_test.go +++ b/ykoath_test.go @@ -2,6 +2,7 @@ package ykoath import ( "fmt" + "slices" "sort" "testing" "time" @@ -392,10 +393,10 @@ func TestList(t *testing.T) { func TestPutAndCalculateTestVector(t *testing.T) { - tt := []struct{ - Name string + tt := []struct { + Name string Query string - } { + }{ { "full identifier", "testvector", @@ -527,7 +528,11 @@ func TestPutAndCalculateTestVector(t *testing.T) { _, err = client.Calculate("test", nil) - assert.EqualError(err, "multiple matches found (testvector1,testvector2)") + if msg := err.Error(); !slices.Contains([]string{ + "multiple matches found (testvector1,testvector2)", + "multiple matches found (testvector2,testvector1)"}, msg) { + assert.Fail(fmt.Sprintf("unexpected error message %q", msg)) + } testCard.AssertExpectations(t) })