Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidaty committed Feb 22, 2024
1 parent 0c771e4 commit c17c9ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ test: ${TESTS}
test-prop:
EXE=${BUILD_DIR}/bin/zsv_prop${EXE} make -C prop test

test-echo : test-echo1 test-echo-overwrite test-echo-eol test-echo-overwrite-csv test-echo-chars
test-echo : test-echo1 test-echo-overwrite test-echo-eol test-echo-overwrite-csv test-echo-chars test-echo-trim

test-echo1: ${BUILD_DIR}/bin/zsv_echo${EXE}
@${TEST_INIT}
Expand All @@ -114,6 +114,11 @@ test-echo-eol-%: ${BUILD_DIR}/bin/zsv_echo${EXE}
@${PREFIX} $< ${TEST_DATA_DIR}/test/no-eol-$*.csv ${REDIRECT} ${TMP_DIR}/$@.out
@${CMP} ${TMP_DIR}/$@.out expected/$@.out && ${TEST_PASS} || ${TEST_FAIL}

test-echo-trim: ${BUILD_DIR}/bin/zsv_echo${EXE}
@${TEST_INIT}
@${PREFIX} $< ${TEST_DATA_DIR}/test/echo-trim.csv ${REDIRECT} ${TMP_DIR}/$@.out
@${CMP} ${TMP_DIR}/$@.out expected/$@.out && ${TEST_PASS} || ${TEST_FAIL}

test-echo-chars: ${BUILD_DIR}/bin/zsv_echo${EXE}
@${TEST_INIT}
@${PREFIX} echo '東京都' | $< -u '?' ${REDIRECT} ${TMP_DIR}/$@.out
Expand Down
2 changes: 2 additions & 0 deletions app/test/expected/test-echo-trim.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hi, there
how ,are, you,?
2 changes: 2 additions & 0 deletions data/test/echo-trim.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hi, there
how ,are, you,?

0 comments on commit c17c9ca

Please sign in to comment.