From 792e55e570f6298b8af81ce5348dd8162827e4e7 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 7 Aug 2023 18:56:12 +0200 Subject: fix: fix split line tests. With help from https://stackoverflow.com/questions/1886374, thank you. --- tests/foundational.bats | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tests') 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" ]] } -- cgit