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