(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func TestValidateMemoryLimit(t *testing.T) { |
| 113 | valid := []string{"4GB", "512MB", "1TB", "256kb", "100 MB", "2 gb", "1.5GB", "0.5MB", "2.75TB"} |
| 114 | for _, v := range valid { |
| 115 | if !ValidateMemoryLimit(v) { |
| 116 | t.Errorf("expected %q to be valid", v) |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | invalid := []string{"", "4", "GB", "lots", "4GB; DROP TABLE", "4'GB"} |
| 121 | for _, v := range invalid { |
| 122 | if ValidateMemoryLimit(v) { |
| 123 | t.Errorf("expected %q to be invalid", v) |
| 124 | } |
| 125 | } |
| 126 | } |
nothing calls this directly
no test coverage detected