MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestValidateMemoryLimit

Function TestValidateMemoryLimit

server/sysinfo/sysinfo_test.go:112–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func 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}

Callers

nothing calls this directly

Calls 1

ValidateMemoryLimitFunction · 0.85

Tested by

no test coverage detected