diff --git a/src/pkg/cli/new_test.go b/src/pkg/cli/new_test.go index cc0c834d8..dcc545ab8 100644 --- a/src/pkg/cli/new_test.go +++ b/src/pkg/cli/new_test.go @@ -2,6 +2,7 @@ package cli import ( "context" + "errors" "testing" ) @@ -10,7 +11,7 @@ func TestInitFromSamples(t *testing.T) { if err == nil { t.Fatal("Expected test to fail") } - if err.Error() != "sample not found" { - t.Error("Expected 'sample not found' error") + if !errors.Is(err, ErrSampleNotFound) { + t.Errorf("Expected error to be %v, got %v", ErrSampleNotFound, err) } }