-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ebd289
commit 900377f
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package schema | ||
|
||
import ( | ||
"errors" | ||
"testing" | ||
) | ||
|
||
func Test_isTableDoesNotExists(t *testing.T) { | ||
type args struct { | ||
err error | ||
} | ||
tests := []struct { | ||
name string | ||
err error | ||
want bool | ||
}{ | ||
{ | ||
name: "bun driver", | ||
err: errors.New("panic: error while fetching applied versions: ERROR: relation \"gwt.mig_schema_versions\" does not exist (SQLSTATE=42P01)\n"), | ||
want: true, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := isTableDoesNotExists(tt.err); got != tt.want { | ||
t.Errorf("isTableDoesNotExists() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |