Organize scheduler unit tests into subtests

This commit is contained in:
drfish
2021-02-02 21:41:20 +08:00
parent 645c40fcf6
commit ebb6fb5b0c
4 changed files with 98 additions and 85 deletions

View File

@@ -111,10 +111,12 @@ func TestMoreImportantPod(t *testing.T) {
}
for k, v := range tests {
got := MoreImportantPod(v.p1, v.p2)
if got != v.expected {
t.Errorf("%s failed, expected %t but got %t", k, v.expected, got)
}
t.Run(k, func(t *testing.T) {
got := MoreImportantPod(v.p1, v.p2)
if got != v.expected {
t.Errorf("expected %t but got %t", v.expected, got)
}
})
}
}