orcli/tests/import-csv.sh

27 lines
324 B
Bash
Raw Normal View History

2022-11-30 23:49:54 +01:00
#!/bin/bash
# environment
t="$(basename "$(pwd)" .sh)"
2022-11-30 23:49:54 +01:00
# data
cat << "DATA" > "${t}.csv"
2022-11-30 23:49:54 +01:00
a,b,c
1,2,3
0,0,0
$,\,'
DATA
# assertion
cat << "DATA" > "${t}.assert"
2022-11-30 23:49:54 +01:00
a b c
1 2 3
0 0 0
$ \ '
DATA
# action
orcli import csv "${t}.csv"
orcli export tsv "${t} csv" --output "${t}.output"
2022-11-30 23:49:54 +01:00
# test
diff -u "${t}.assert" "${t}.output"