mirror of
https://github.com/restic/restic.git
synced 2026-10-22 08:58:11 +00:00
forget: Fail test if duration parsing error is missing
This commit is contained in:
1 parent
6f517858e8
commit
bb27f7408c
2 files changed
+9
-2
No files matched your search
@@ -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