aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-08-07 18:56:12 +0200
committerMatěj Cepl <mcepl@cepl.eu>2023-08-11 11:59:10 +0200
commit792e55e570f6298b8af81ce5348dd8162827e4e7 (patch)
tree790e93661832e8abe231e1fafb3b7fd2b73f10b5 /tests
parent130e1d1c8ae3b951e1f499b6d428062c050c7aa9 (diff)
downloadpinentry-rofi-792e55e570f6298b8af81ce5348dd8162827e4e7.tar.gz
fix: fix split line tests.
With help from https://stackoverflow.com/questions/1886374, thank you.
Diffstat (limited to 'tests')
-rw-r--r--tests/foundational.bats10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/foundational.bats b/tests/foundational.bats
index c2768c2..29b8881 100644
--- a/tests/foundational.bats
+++ b/tests/foundational.bats
@@ -11,22 +11,20 @@ log_debug() {
}
@test "split line" {
- line_arr=("$(split_line "GETINFO version")")
+ line_arr=($(split_line "GETINFO version"))
[ "${line_arr[0]}" = "version" ]
}
@test "split line rmfirst" {
- line_arr=("$(split_line "GETINFO version" 0)")
+ line_arr=($(split_line "GETINFO version" 0))
[ "${line_arr[0]}" = "version" ]
}
@test "split line no-rmfirst" {
- skip "Not yet"
- IFS=" " line_arr=("$(split_line "GETINFO version" 1)")
+ IFS=" " line_arr=($(split_line "GETINFO version" 1))
[[ "$(declare -p line_arr)" == 'declare -'[aA]* ]]
- log_debug "$(declare -p line_arr)"
[[ "${line_arr[0]}" == "GETINFO" ]]
- [[ ${#line_arr} -eq 2 ]]
+ [[ ${#line_arr[@]} -eq 2 ]]
[[ "${line_arr[1]}" == "version" ]]
}