change failing test to use subtests
This commit is contained in:
parent
a5cb530571
commit
7715bc8423
|
@ -1,6 +1,7 @@
|
||||||
package state
|
package state
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -77,6 +78,7 @@ func TestCacheState_RefreshState(t *testing.T) {
|
||||||
expected: CacheRefreshLocalNewer,
|
expected: CacheRefreshLocalNewer,
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
|
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
|
||||||
cache := testLocalState(t)
|
cache := testLocalState(t)
|
||||||
durable := testLocalState(t)
|
durable := testLocalState(t)
|
||||||
defer os.Remove(cache.Path)
|
defer os.Remove(cache.Path)
|
||||||
|
@ -100,6 +102,7 @@ func TestCacheState_RefreshState(t *testing.T) {
|
||||||
if cs.RefreshResult() != test.expected {
|
if cs.RefreshResult() != test.expected {
|
||||||
t.Fatalf("bad %d: %v", i, cs.RefreshResult())
|
t.Fatalf("bad %d: %v", i, cs.RefreshResult())
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue