mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-21 09:51:50 +00:00
Improve test defs: assertions in unpack_stdout_list()
This commit is contained in:
parent
2802f75fa2
commit
eda128c10e
@ -96,6 +96,7 @@ unpack_stdout_list() {
|
||||
{
|
||||
local n
|
||||
read n
|
||||
assertExpr --stdout --message="line 1: malformed list" "$n" '~' '^[0-9]\+$'
|
||||
eval ${prefix}NCOLS=\"\$n\"
|
||||
declare -a ${prefix}HEADER
|
||||
local -a header
|
||||
@ -103,6 +104,7 @@ unpack_stdout_list() {
|
||||
IFS=:
|
||||
read -r -a header
|
||||
IFS="$oIFS"
|
||||
assertExpr --stdout --message="line 2: malformed list" "${#header[*]}" == "$n"
|
||||
eval ${prefix}HEADER="(\"\${header[@]}\")"
|
||||
local hdr
|
||||
local -a colvars=()
|
||||
@ -126,7 +128,7 @@ unpack_stdout_list() {
|
||||
done
|
||||
IFS="$oIFS"
|
||||
eval ${prefix}NROWS=$i
|
||||
} < <(replayStdout)
|
||||
} <"$TFWSTDOUT"
|
||||
}
|
||||
|
||||
# Utility function for creating servald fixtures:
|
||||
|
Loading…
x
Reference in New Issue
Block a user