orcli/tests/import-csv.sh

29 lines
383 B
Bash
Raw Normal View History

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