mirror of
https://github.com/restic/restic.git
synced 2025-12-04 03:38:25 +00:00
forget: Fail test if duration parsing error is missing
This commit is contained in:
@@ -83,8 +83,14 @@ func TestParseDuration(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
t.Run("", func(t *testing.T) {
|
||||
d, err := ParseDuration(test.input)
|
||||
if err != nil && !test.err {
|
||||
t.Fatal(err)
|
||||
if test.err {
|
||||
if err == nil {
|
||||
t.Fatalf("Missing error for %v", test.input)
|
||||
}
|
||||
} else {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
if !cmp.Equal(d, test.d) {
|
||||
|
||||
Reference in New Issue
Block a user