Skip to content

Commit

Permalink
[CI] Update sheet command tests (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazeem authored Oct 8, 2024
1 parent 6046527 commit b81d5d8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
41 changes: 19 additions & 22 deletions app/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -558,34 +558,31 @@ test-compare: test-%: ${BUILD_DIR}/bin/zsv_%${EXE}

test-sheet: test-%: ${BUILD_DIR}/bin/zsv_%${EXE} worldcitiespop_mil.csv
@${TEST_INIT}
@(tmux new-session -x 1000 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \
tmux set-window-option -t test-sheet prefix none && \
sleep 0.5 && \
tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@1.out && \
tmux send-keys -t $@ "q" && \
@(echo 'set-option default-terminal "tmux-256color"' > ~/.tmux.conf && \
tmux new-session -x 1000 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \
sleep 0.5)

@(tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/[email protected] && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})

@(tmux new-session -x 1000 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \
tmux set-window-option -t test-sheet prefix none && \
sleep 0.5 && \
tmux send-keys -t $@ "C-F" && \
@(tmux send-keys -t $@ C-f C-f C-b && \
tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/[email protected] && \
tmux send-keys -t $@ "q" && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})

@(tmux new-session -x 1000 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \
tmux set-window-option -t test-sheet prefix none && \
@(tmux send-keys -t $@ f sarmaj Enter && \
sleep 0.5 && \
tmux send-keys -t $@ "C-F" "C-F" "C-B" && \
tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/[email protected] && \
tmux send-keys -t $@ "q" && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})
tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/[email protected] && \
tmux send-keys -t $@ Escape Escape && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})

@(tmux new-session -x 1000 -y 5 -d -s $@ "${PREFIX} $< worldcitiespop_mil.csv" && \
tmux set-window-option -t test-sheet prefix none && \
sleep 0.5 && \
tmux send-keys -t $@ "f" "sarmaj" Enter && \
@(tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/[email protected] && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})

@(tmux send-keys -t $@ S-Down C-b && \
sleep 0.5 && \
tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@3.out && \
tmux capture-pane -t $@ -p ${REDIRECT1} ${TMP_DIR}/$@4.out && \
tmux send-keys -t $@ "q" && \
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && ${TEST_PASS} || ${TEST_FAIL})
${CMP} ${TMP_DIR}/[email protected] expected/[email protected] && \
${TEST_PASS} || ${TEST_FAIL})

@(! tmux kill-session -t $@ 2>/dev/null && ${TEST_PASS} || ${TEST_FAIL})
5 changes: 5 additions & 0 deletions app/test/expected/test-sheet4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Row # Country City AccentCit Region Populatio Latitude Longitude
999995 ml fallou Fallou 08 15.516666 -4.366666
999996 gw quenem Quenem 04 12.228333 -15.64444
999997 ph villa gar Villa Gar 29 17.033333 120.45
999997

0 comments on commit b81d5d8

Please sign in to comment.