(t *testing.T)
| 244 | } |
| 245 | |
| 246 | func TestFormatImporterReason(t *testing.T) { |
| 247 | reason := formatImporterReason("scanner/types.go", 5) |
| 248 | if reason == "" { |
| 249 | t.Error("expected non-empty reason") |
| 250 | } |
| 251 | if !contains(reason, "scanner/types.go") { |
| 252 | t.Error("reason should mention the file") |
| 253 | } |
| 254 | if !contains(reason, "5") { |
| 255 | t.Error("reason should mention the count") |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | func contains(s, substr string) bool { |
| 260 | return len(s) >= len(substr) && (s == substr || len(s) > 0 && containsHelper(s, substr)) |
nothing calls this directly
no test coverage detected