mirror of
https://github.com/ferdzo/fs.git
synced 2026-06-04 05:26:46 +00:00
Add upload limits and multipart cleanup
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
21
utils/config_test.go
Normal file
21
utils/config_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package utils
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestEnvInt64Range(t *testing.T) {
|
||||
t.Setenv("TEST_INT64_RANGE", "42")
|
||||
if got := envInt64Range("TEST_INT64_RANGE", 10, 1, 100); got != 42 {
|
||||
t.Fatalf("envInt64Range valid = %d, want 42", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnvInt64RangeFallsBackForInvalidValues(t *testing.T) {
|
||||
t.Setenv("TEST_INT64_RANGE", "invalid")
|
||||
if got := envInt64Range("TEST_INT64_RANGE", 10, 1, 100); got != 10 {
|
||||
t.Fatalf("envInt64Range invalid = %d, want 10", got)
|
||||
}
|
||||
t.Setenv("TEST_INT64_RANGE", "101")
|
||||
if got := envInt64Range("TEST_INT64_RANGE", 10, 1, 100); got != 10 {
|
||||
t.Fatalf("envInt64Range too large = %d, want 10", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user