postgresql/common/tests/test-lib/path_foreach
2020-11-02 16:19:41 +01:00

24 lines
340 B
Bash
Executable file

#! /bin/bash
set -e
. test-lib.sh
path='a b c:d x:y'
exp_output="==a b c==
==.==
==d x==
==.==
==y==
==.=="
wrap() { for arg; do echo "==$arg=="; done; }
test "$(ct_path_foreach "$path" wrap .)" == "$exp_output"
ct_path_append path '/a'
exp_output="==/a==
==.==
$exp_output"
test "$(ct_path_foreach "$path" wrap .)" == "$exp_output"