fix: correct path required proto testdata (#14991)

This commit is contained in:
Julien Robert
2023-02-11 16:59:16 +00:00
committed by GitHub
parent 467b4f25b8
commit a90569c7e4
38 changed files with 3351 additions and 3350 deletions
+25
View File
@@ -0,0 +1,25 @@
package testutil
import "testing"
func AssertPanics(t *testing.T, f func()) {
panicked := false
defer func() {
if r := recover(); r != nil {
panicked = true
}
}()
f()
if !panicked {
t.Errorf("should panic")
}
}
func AssertNotPanics(t *testing.T, f func()) {
defer func() {
if r := recover(); r != nil {
t.Errorf("should not panic: %v", r)
}
}()
f()
}