From 955878633d813064aeb22b08c55990b097ad160d Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 16 Feb 2024 16:56:36 +0100 Subject: [PATCH] Make TestPutInMemoryDB work with Go versions before 1.13 --- test/box_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/box_test.go b/test/box_test.go index a50618b..f31ef93 100644 --- a/test/box_test.go +++ b/test/box_test.go @@ -17,7 +17,6 @@ package objectbox_test import ( - "errors" "github.com/objectbox/objectbox-go/test/assert" "github.com/objectbox/objectbox-go/test/model" "github.com/objectbox/objectbox-go/test/model/iot" @@ -176,7 +175,8 @@ func TestPutInMemoryDB(t *testing.T) { var dir = "memory:iot-test" env := iot.NewTestEnvWithDir(t, dir) _, err := os.Stat(dir) - assert.True(t, errors.Is(err, os.ErrNotExist)) // Must not exist in file system + assert.Err(t, err) // Must not exist in file system + // This is Go 1.13+ only: assert.True(t, errors.Is(err, os.ErrNotExist)) // Must not exist in file system RunTestPut(t, env) }