orcli/tests/import-csv.sh

18 lines
348 B
Bash
Raw Normal View History

2022-11-30 23:49:54 +01:00
#!/bin/bash
2022-12-03 01:30:01 +01:00
t="import-csv"
2022-11-30 23:49:54 +01:00
2022-12-03 01:30:01 +01:00
# environment
tmpdir="$(mktemp -d)"
trap '{ rm -rf "${tmpdir}"; }' 0 2 3 15
cp data/example.csv "${tmpdir}"/${t}.csv
cp data/example.tsv "${tmpdir}"/${t}.assert
cd "${tmpdir}" || exit 1
2022-11-30 23:49:54 +01:00
# action
orcli import csv "${t}.csv"
orcli export tsv "${t} csv" --output "${t}.output"
2022-11-30 23:49:54 +01:00
# test
2022-12-03 01:30:01 +01:00
diff -u "${t}.assert" "${t}.output"