TestValidator_FormatBytes tests byte formatting
(t *testing.T)
| 381 | |
| 382 | // TestValidator_FormatBytes tests byte formatting |
| 383 | func TestValidator_FormatBytes(t *testing.T) { |
| 384 | tests := []struct { |
| 385 | bytes int64 |
| 386 | expected string |
| 387 | }{ |
| 388 | {0, "0 B"}, |
| 389 | {1, "1 B"}, |
| 390 | {1023, "1023 B"}, |
| 391 | {1024, "1.0 KB"}, |
| 392 | {1536, "1.5 KB"}, |
| 393 | {1048576, "1.0 MB"}, |
| 394 | {1073741824, "1.0 GB"}, |
| 395 | {1099511627776, "1.0 TB"}, |
| 396 | } |
| 397 | |
| 398 | for _, tt := range tests { |
| 399 | t.Run(tt.expected, func(t *testing.T) { |
| 400 | result := formatBytes(tt.bytes) |
| 401 | if result != tt.expected { |
| 402 | t.Errorf("formatBytes(%d) = %s, want %s", tt.bytes, result, tt.expected) |
| 403 | } |
| 404 | }) |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | // TestValidator_DisplayStats tests statistics display |
| 409 | func TestValidator_DisplayStats(t *testing.T) { |
nothing calls this directly
no test coverage detected