Skip to content

Commit 5afaf49

Browse files
committed
Renamed assert_count() to assert_num_string_occurrences()
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 4ff81a5 commit 5afaf49

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/shell/039_add_added_by_field_update_1.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ assert_file_matches_regex cfbs.json '"added_by".*"cfbs init"'
1111

1212
cfbs --non-interactive add package-method-winget
1313
assert_file_matches_regex cfbs.json '"added_by".*"package-method-winget"'
14-
assert_count 1 cfbs.json '"cfbs add"'
14+
assert_num_string_occurrences 1 cfbs.json '"cfbs add"'
1515

1616
cfbs --non-interactive add powershell-execution-policy
1717
assert_file_not_contains cfbs.json '"added_by": "package-method-winget"'
18-
assert_count 2 cfbs.json '"cfbs add"'
18+
assert_num_string_occurrences 2 cfbs.json '"cfbs add"'
1919

2020
test_finish

tests/shell/testlib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ assert_no_diff() {
134134
|| _test_fail "Expected files to differ but they are identical: $1 vs $2"
135135
}
136136

137-
assert_count() {
137+
assert_num_string_occurrences() {
138138
local expected="$1" file="$2" pattern="$3"
139139
local actual
140140
actual=$(grep -cF "$pattern" "$file" || true)

0 commit comments

Comments
 (0)