Skip to content

Commit bfde82c

Browse files
committed
Fix trivial test failures caused by string changes
1 parent 5402cf9 commit bfde82c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

testsuite_cli_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ func TestCli(t *testing.T) {
112112
{args: []string{"xyz"}, code: 13, stderrContains: "extra argument not understood", stdoutEmpty: true},
113113
{args: []string{"-i", "1"}, code: 13, stderrContains: "extra argument not understood", stdoutEmpty: true},
114114
// Tuples
115-
{args: []string{"-m", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem <= 2.00% and swap <= 10.00%", stdoutContains: memReport},
115+
{args: []string{"-m", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem avail <= 2.00% and swap free <= 10.00%", stdoutContains: memReport},
116116
{args: []string{"-m", "1,2"}, code: -1, stdoutContains: memReport},
117117
{args: []string{"-m", "1,-1"}, code: 15, stderrContains: "fatal", stdoutEmpty: true},
118118
{args: []string{"-m", "1000,-1000"}, code: 15, stderrContains: "fatal", stdoutEmpty: true},
119-
{args: []string{"-s", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem <= 10.00% and swap <= 2.00%", stdoutContains: memReport},
119+
{args: []string{"-s", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem avail <= 10.00% and swap free <= 2.00%", stdoutContains: memReport},
120120
{args: []string{"-s", "1,2"}, code: -1, stdoutContains: memReport},
121121
// https://github.com/rfjakob/earlyoom/issues/97
122122
{args: []string{"-m", "5,0"}, code: -1, stdoutContains: memReport},
@@ -135,18 +135,18 @@ func TestCli(t *testing.T) {
135135
{args: []string{"-s", tooBigInt32}, code: 16, stderrContains: "fatal", stdoutEmpty: true},
136136
{args: []string{"-s", tooBigUint32}, code: 16, stderrContains: "fatal", stdoutEmpty: true},
137137
// Floating point values
138-
{args: []string{"-m", "3.14"}, code: -1, stderrContains: "SIGTERM when mem <= 3.14%", stdoutContains: memReport},
139-
{args: []string{"-m", "7,3.14"}, code: -1, stderrContains: "SIGKILL when mem <= 3.14%", stdoutContains: memReport},
140-
{args: []string{"-s", "12.34"}, code: -1, stderrContains: "swap <= 12.34%", stdoutContains: memReport},
138+
{args: []string{"-m", "3.14"}, code: -1, stderrContains: "SIGTERM when mem avail <= 3.14%", stdoutContains: memReport},
139+
{args: []string{"-m", "7,3.14"}, code: -1, stderrContains: "SIGKILL when mem avail <= 3.14%", stdoutContains: memReport},
140+
{args: []string{"-s", "12.34"}, code: -1, stderrContains: "swap free <= 12.34%", stdoutContains: memReport},
141141
// Use both -m/-M
142-
{args: []string{"-m", "10", "-M", mem1percent}, code: -1, stderrContains: "SIGTERM when mem <= 1.00%", stdoutContains: memReport},
142+
{args: []string{"-m", "10", "-M", mem1percent}, code: -1, stderrContains: "SIGTERM when mem avail <= 1.00%", stdoutContains: memReport},
143143
}
144144
if swapTotal > 0 {
145145
// Tests that cannot work when there is no swap enabled
146146
tc := []cliTestCase{
147147
{args: []string{"-S", swap2percent}, code: -1, stderrContains: " 2.00%", stdoutContains: memReport},
148148
// Use both -s/-S
149-
{args: []string{"-s", "10", "-S", swap2percent}, code: -1, stderrContains: "swap <= 1.00%", stdoutContains: memReport},
149+
{args: []string{"-s", "10", "-S", swap2percent}, code: -1, stderrContains: "swap free <= 1.00%", stdoutContains: memReport},
150150
}
151151
testcases = append(testcases, tc...)
152152
}

0 commit comments

Comments
 (0)