added support for a few middlewares, added match_domain option, changed index reference prefix from $ to #, etc.

This commit is contained in:
yusing
2024-09-27 09:57:57 +08:00
parent 345a4417a6
commit f474ae4f75
47 changed files with 1523 additions and 446 deletions

View File

@@ -38,6 +38,17 @@ func ExpectEqual[T comparable](t *testing.T, got T, want T) {
}
}
func ExpectEqualAny[T comparable](t *testing.T, got T, wants []T) {
t.Helper()
for _, want := range wants {
if got == want {
return
}
}
t.Errorf("expected any of:\n%v, got\n%v", wants, got)
t.FailNow()
}
func ExpectDeepEqual[T any](t *testing.T, got T, want T) {
t.Helper()
if !reflect.DeepEqual(got, want) {