(t *testing.T)
| 229 | } |
| 230 | |
| 231 | func TestPrintBanner_Default(t *testing.T) { |
| 232 | dir := createTestTaskDir(t) |
| 233 | s := NewServer(Config{Port: 8080, ScanDir: dir}) |
| 234 | |
| 235 | output := captureStdout(t, func() { |
| 236 | s.printBanner() |
| 237 | }) |
| 238 | |
| 239 | if !strings.Contains(output, "http://localhost:8080") { |
| 240 | t.Errorf("expected banner to show port 8080, got %q", output) |
| 241 | } |
| 242 | if !strings.Contains(output, fmt.Sprintf("Watching %s", dir)) { |
| 243 | t.Errorf("expected banner to show scan dir, got %q", output) |
| 244 | } |
| 245 | if strings.Contains(output, "Read-only") { |
| 246 | t.Error("unexpected read-only message in default mode") |
| 247 | } |
| 248 | if strings.Contains(output, "Dev mode") { |
| 249 | t.Error("unexpected dev mode message in default mode") |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | func TestPrintBanner_ReadOnlyAndDev(t *testing.T) { |
| 254 | dir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected