Skip to content

Commit 2fd0ca1

Browse files
committed
Fix more test constants
1 parent 64be8d6 commit 2fd0ca1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

agent/internal/posture/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,7 @@ const (
5252
versionPartIndex = 2
5353
defaultsCommand = "defaults"
5454
readCommand = "read"
55+
testRuleCount = 10
56+
testNumber123 = 123
57+
testNumberNeg456 = -456
5558
)

agent/internal/posture/posture_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func TestDevicePosture_ToJSON(t *testing.T) {
127127
},
128128
Firewall: FirewallStatus{
129129
Enabled: true,
130-
Rules: 10,
130+
Rules: testRuleCount,
131131
Service: "ufw",
132132
},
133133
AntiVirus: false,
@@ -244,9 +244,9 @@ func TestParseInt(t *testing.T) {
244244
input string
245245
expected int
246246
}{
247-
{"123", 123},
247+
{"123", testNumber123},
248248
{"0", 0},
249-
{"-456", -456},
249+
{"-456", testNumberNeg456},
250250
{"invalid", 0},
251251
{"", 0},
252252
{"12.34", 0}, // Should fail for non-integer

0 commit comments

Comments
 (0)