Lint tests

This commit is contained in:
JY Tan
2025-12-18 17:58:26 -08:00
parent 2abda47b0a
commit 299adcae33
3 changed files with 7 additions and 7 deletions

View File

@@ -195,7 +195,7 @@ func TestLoad(t *testing.T) {
content: "",
setup: func(dir string) string {
path := filepath.Join(dir, "empty.json")
_ = os.WriteFile(path, []byte(""), 0o644)
_ = os.WriteFile(path, []byte(""), 0o600)
return path
},
wantNil: true,
@@ -206,7 +206,7 @@ func TestLoad(t *testing.T) {
content: " \n\t ",
setup: func(dir string) string {
path := filepath.Join(dir, "whitespace.json")
_ = os.WriteFile(path, []byte(" \n\t "), 0o644)
_ = os.WriteFile(path, []byte(" \n\t "), 0o600)
return path
},
wantNil: true,
@@ -217,7 +217,7 @@ func TestLoad(t *testing.T) {
setup: func(dir string) string {
path := filepath.Join(dir, "valid.json")
content := `{"network":{"allowedDomains":["example.com"]}}`
_ = os.WriteFile(path, []byte(content), 0o644)
_ = os.WriteFile(path, []byte(content), 0o600)
return path
},
wantNil: false,
@@ -235,7 +235,7 @@ func TestLoad(t *testing.T) {
name: "invalid JSON",
setup: func(dir string) string {
path := filepath.Join(dir, "invalid.json")
_ = os.WriteFile(path, []byte("{invalid json}"), 0o644)
_ = os.WriteFile(path, []byte("{invalid json}"), 0o600)
return path
},
wantNil: false,
@@ -246,7 +246,7 @@ func TestLoad(t *testing.T) {
setup: func(dir string) string {
path := filepath.Join(dir, "invalid_domain.json")
content := `{"network":{"allowedDomains":["*.com"]}}`
_ = os.WriteFile(path, []byte(content), 0o644)
_ = os.WriteFile(path, []byte(content), 0o600)
return path
},
wantNil: false,