Skip to content

Commit

Permalink
improved testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisyhjiang committed Jun 27, 2024
1 parent c2a54b5 commit d8a1d72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pkg/cli/new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"context"
"errors"
"testing"
)

Expand All @@ -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)
}
}

0 comments on commit d8a1d72

Please sign in to comment.