diff options
| author | mo khan <mo@mokhan.ca> | 2026-01-30 17:18:31 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2026-01-30 17:18:31 -0700 |
| commit | e4ed0342932b0aa741ee78d9e4fe135eba6e9ca7 (patch) | |
| tree | f1e7f602cb86e78aedf04185b2c2e1428fc5b8f2 /pkg/gitdiff/assert_test.go | |
| parent | 83be9ddcf82e8a90ea50a9d54c1ebfc3e22ace16 (diff) | |
initial commit
Diffstat (limited to 'pkg/gitdiff/assert_test.go')
| -rw-r--r-- | pkg/gitdiff/assert_test.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/pkg/gitdiff/assert_test.go b/pkg/gitdiff/assert_test.go deleted file mode 100644 index 878f13c..0000000 --- a/pkg/gitdiff/assert_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package gitdiff - -import ( - "errors" - "strings" - "testing" -) - -func assertError(t *testing.T, expected interface{}, actual error, action string) { - if actual == nil { - t.Fatalf("expected error %s, but got nil", action) - } - - switch exp := expected.(type) { - case bool: - if !exp { - t.Fatalf("unexpected error %s: %v", action, actual) - } - case string: - if !strings.Contains(actual.Error(), exp) { - t.Fatalf("incorrect error %s: %q does not contain %q", action, actual.Error(), exp) - } - case error: - if !errors.Is(actual, exp) { - t.Fatalf("incorrect error %s: expected %T (%v), actual: %T (%v)", action, exp, exp, actual, actual) - } - default: - t.Fatalf("unsupported expected error type: %T", exp) - } -} |
