New test file for specific code section or data type
This commit is contained in:
@@ -54,6 +54,14 @@ func TestIsString(t *testing.T) {
|
||||
succeeded++
|
||||
}
|
||||
|
||||
count++
|
||||
if isIterator("fake") {
|
||||
t.Errorf(`%d: isIterator("fake") -> result = true, want false`, count)
|
||||
failed++
|
||||
} else {
|
||||
succeeded++
|
||||
}
|
||||
|
||||
count++
|
||||
b, ok := toBool(true)
|
||||
if !(ok && b) {
|
||||
@@ -72,6 +80,15 @@ func TestIsString(t *testing.T) {
|
||||
succeeded++
|
||||
}
|
||||
|
||||
count++
|
||||
b, ok = toBool([]int{})
|
||||
if ok {
|
||||
t.Errorf("%d: toBool([]) b=%v, ok=%v -> result = true, want false", count, b, ok)
|
||||
failed++
|
||||
} else {
|
||||
succeeded++
|
||||
}
|
||||
|
||||
t.Logf("test count: %d, succeeded count: %d, failed count: %d", count, succeeded, failed)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user