Skip to content

Commit b27109b

Browse files
committed
Quick Save
1 parent b2bcb95 commit b27109b

File tree

1 file changed

+38
-19
lines changed

1 file changed

+38
-19
lines changed

test_cmds.bash

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -665,22 +665,22 @@ function test_jsonrange(){
665665

666666
function test_range(){
667667
EXPECTED="1 2 3 4 5"
668-
RESULT=$(range 1 5)
668+
RESULT=$(bin/range 1 5)
669669
assert_equal "test_range (range 1 5)" "$EXPECTED" "$RESULT"
670670

671671
EXPECTED="-2 -1 0 1 2 3 4 5 6"
672-
RESULT=$(range -- -2 6)
672+
RESULT=$(bin/range -- -2 6)
673673
assert_equal "test_range (range -- -2 6)" "$EXPECTED" "$RESULT"
674674

675675
EXPECTED="2 4 6 8 10"
676-
RESULT=$(range -increment=2 2 10)
676+
RESULT=$(bin/range -increment=2 2 10)
677677
assert_equal "test_range (range -increment=2 2 10)" "$EXPECTED" "$RESULT"
678678

679679
EXPECTED="10 9 8 7 6 5 4 3 2 1"
680-
RESULT=$(range 10 1)
680+
RESULT=$(bin/range 10 1)
681681
assert_equal "test_range (range 10 1)" "$EXPECTED" "$RESULT"
682682

683-
I=$(range -random 0 10)
683+
I=$(bin/range -random 0 10)
684684
if [[ "$I" -lt "0" || "$I" -gt "10" ]]; then
685685
echo "range -random 0 10: $I (error, out of range)"
686686
exit 1
@@ -690,70 +690,89 @@ function test_range(){
690690

691691
function test_reldate(){
692692
EXPECTED='2014-08-04'
693-
RESULT=$(reldate -from=2014-08-01 3 days)
693+
RESULT=$(bin/reldate -from=2014-08-01 3 days)
694694
assert_equal "test_reldate (1)" "$EXPECTED" "$RESULT"
695695

696696
EXPECTED='2014-08-06'
697-
RESULT=$(reldate --from=2014-08-03 3 days)
697+
RESULT=$(bin/reldate --from=2014-08-03 3 days)
698698
assert_equal "test_reldate (2)" "$EXPECTED" "$RESULT"
699699

700700
EXPECTED='2014-07-31'
701-
RESULT=$(reldate --from=2014-08-03 -- -3 days)
701+
RESULT=$(bin/reldate --from=2014-08-03 -- -3 days)
702702
assert_equal "test_reldate (3)" "$EXPECTED" "$RESULT"
703703

704704
EXPECTED='2015-02-09'
705-
RESULT=$(reldate --from=2015-02-10 Monday)
705+
RESULT=$(bin/reldate --from=2015-02-10 Monday)
706706
assert_equal "test_reldate (4)" "$EXPECTED" "$RESULT"
707707
echo "test_reldate OK";
708708
}
709709

710710
function test_timefmt(){
711711

712712
EXPECTED='12/02/2017'
713-
RESULT=$(timefmt -if "2006-01-02" -of "01/02/2006" "2017-12-02")
713+
RESULT=$(bin/timefmt -if "2006-01-02" -of "01/02/2006" "2017-12-02")
714714
assert_equal "test_timefmt (1)" "$EXPECTED" "$RESULT"
715715

716716
EXPECTED='02 Dec 17 08:08 UTC'
717-
RESULT=$(timefmt -input-format mysql -output-format RFC822 "2017-12-02 08:08:08")
717+
RESULT=$(bin/timefmt -input-format mysql -output-format RFC822 "2017-12-02 08:08:08")
718718
assert_equal "test_timefmt (2)" "$EXPECTED" "$RESULT"
719719

720720
echo "test_timefmt OK";
721721
}
722722

723723
function test_urlparse(){
724724
EXPECTED='http example.com /my/page.html'
725-
RESULT=$(urlparse http://example.com/my/page.html)
725+
RESULT=$(bin/urlparse http://example.com/my/page.html)
726726
assert_equal "test_urlparse (1)" "$EXPECTED" "$RESULT"
727727

728728
EXPECTED='http'
729-
RESULT="$(urlparse -protocol http://example.com/my/page.html)"
729+
RESULT="$(bin/urlparse -protocol http://example.com/my/page.html)"
730730
assert_equal "test_urlparse (2)" "$EXPECTED" "$RESULT"
731731

732732
EXPECTED='example.com'
733-
RESULT="$(urlparse -host http://example.com/my/page.html)"
733+
RESULT="$(bin/urlparse -host http://example.com/my/page.html)"
734734
assert_equal "test_urlparse (3)" "$EXPECTED" "$RESULT"
735735

736736
EXPECTED='/my/page.html'
737-
RESULT="$(urlparse -path http://example.com/my/page.html)"
737+
RESULT="$(bin/urlparse -path http://example.com/my/page.html)"
738738
assert_equal "test_urlparse (4)" "$EXPECTED" "$RESULT"
739739

740740
EXPECTED='/my'
741-
RESULT="$(urlparse -dirname http://example.com/my/page.html)"
741+
RESULT="$(bin/urlparse -dirname http://example.com/my/page.html)"
742742
assert_equal "test_urlparse (5)" "$EXPECTED" "$RESULT"
743743

744744
EXPECTED='page.html'
745-
RESULT="$(urlparse -basename http://example.com/my/page.html)"
745+
RESULT="$(bin/urlparse -basename http://example.com/my/page.html)"
746746
assert_equal "test_urlparse (6)" "$EXPECTED" "$RESULT"
747747

748748
EXPECTED='.html'
749-
RESULT="$(urlparse -extname http://example.com/my/page.html)"
749+
RESULT="$(bin/urlparse -extname http://example.com/my/page.html)"
750750
assert_equal "test_urlparse (7)" "$EXPECTED" "$RESULT"
751751

752752
echo "test_urlparse OK";
753753
}
754754

755755
function test_xlsx2csv(){
756-
echo "test_xlsx2csv skipping, not implemented";
756+
bin/xlsx2csv demos/xlsx2csv/MyWorkbook.xlsx "My worksheet 1" > demos/xlsx2csv/sheet1.csv
757+
cmp demos/xlsx2csv/sheet1.csv demos/xlsx2csv/expected1.csv
758+
if [ "$?" != "0" ]; then
759+
exit 1
760+
fi
761+
762+
echo -n "Count the sheets in MyWorkbook.xlsx: "
763+
bin/xlsx2csv -nl -count demos/xlsx2csv/MyWorkbook.xlsx
764+
echo ''
765+
766+
echo -n "List the sheets in MyWorkbook.xlsx: "
767+
bin/xlsx2csv -sheets demos/xlsx2csv/MyWorkbook.xlsx
768+
echo ''
769+
770+
# bin/xlsx2csv -N demos/xlsx2csv/MyWorkbook.xlsx | while read SHEET_NAME; do
771+
# CSV_NAME="${SHEET_NAME// /-}.csv"
772+
# bin/xlsx2csv -o "${CSV_NAME}" demos/xlsx2csv/MyWorkbook.xlsx "${SHEET_NAME}"
773+
# done
774+
775+
echo "test_xlsx2csv OK";
757776
}
758777

759778
function test_xlsx2json(){

0 commit comments

Comments
 (0)