Skip to content

Commit

Permalink
feat: Add tests for errs.go
Browse files Browse the repository at this point in the history
  • Loading branch information
dadav committed Dec 22, 2024
1 parent c494e6b commit e7be30a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pkg/schema/err_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package schema

import "testing"

func TestCircularError(t *testing.T) {
tests := []struct {
name string
message string
want string
}{
{
name: "basic error message",
message: "circular dependency detected",
want: "circular dependency detected",
},
{
name: "empty message",
message: "",
want: "",
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := &CircularError{msg: tt.message}
if got := err.Error(); got != tt.want {
t.Errorf("CircularError.Error() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit e7be30a

Please sign in to comment.