(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestAutoMemoryLimit(t *testing.T) { |
| 10 | // Reset cached value so test is independent |
| 11 | autoMemoryLimitOnce = sync.Once{} |
| 12 | autoMemoryLimitValue = "" |
| 13 | |
| 14 | result := AutoMemoryLimit() |
| 15 | if result == "" { |
| 16 | t.Fatal("AutoMemoryLimit returned empty string") |
| 17 | } |
| 18 | |
| 19 | // On Linux (CI and production), we should detect system memory |
| 20 | if runtime.GOOS == "linux" { |
| 21 | totalBytes := readSystemMemoryBytes() |
| 22 | if totalBytes == 0 { |
| 23 | t.Fatal("totalSystemMemoryBytes returned 0 on Linux") |
| 24 | } |
| 25 | t.Logf("Detected system memory: %d bytes, auto limit: %s", totalBytes, result) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestAutoMemoryLimitFormat(t *testing.T) { |
| 30 | // Reset cached value so test is independent |
nothing calls this directly
no test coverage detected