Merge pull request #10 from CS489-Tmux-Team8/judie_branch

"Create testing workflow
pull/3902/head
Jia Hu 2024-03-20 23:44:31 -04:00 committed by GitHub
commit 4360ac4783
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 63 additions and 5 deletions

48
.github/workflows/ic.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Build and Test
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies for Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get -y install bison \
autotools-dev \
libncurses5-dev \
libevent-dev \
pkg-config \
libutempter-dev \
build-essential
if [ "${{ matrix.build }}" == "musl" ] || [ "${{ matrix.build }}" == "musl-static" ]; then
sudo apt-get -y install musl-dev \
musl-tools
fi
# Add steps for other operating systems if needed, similar to the Linux steps above.
- name: Build tmux
run: |
sh autogen.sh
./configure
make
# Add additional steps for running tests if applicable.
- name: Run Tests
working-directory: ./regress
run: |
for test_script in *.sh; do
chmod +x $test_script
echo Running test $test_script
./$test_script
done

View File

@ -42,14 +42,24 @@ $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word-end
$TMUX send-keys -X next-word-end
$TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "words\n Indented")" ] || exit 1
if [ "$($TMUX show-buffer)" != "$(printf "words\n Indented")" ]
then
actual=$($TMUX show-buffer)
expected=$(printf "words\n Indented")
echo "actual: "
echo $actual
echo "expected: "
echo $expected
exit 1
fi
# Test that `next-word` wraps around un-indented line breaks.
$TMUX send-keys -X next-word
$TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word
$TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line\n")" ] || exit 1
[ "$($TMUX show-buffer)" = "$(printf "line\n")" ] || exit 1
# Test that `next-word-end` treats periods as letters.
$TMUX send-keys -X next-word
@ -63,14 +73,14 @@ $TMUX send-keys -X previous-word
$TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word
$TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line...\n")" ] || exit 1
[ "$($TMUX show-buffer)" = "$(printf "line...\n")" ] || exit 1
# Test that `previous-space` and `next-space` treat periods as letters.
$TMUX send-keys -X previous-space
$TMUX send-keys -X begin-selection
$TMUX send-keys -X next-space
$TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line...\n")" ] || exit 1
[ "$($TMUX show-buffer)" = "$(printf "line...\n")" ] || exit 1
# Test that `next-word` and `next-word-end` treat other symbols as letters.
$TMUX send-keys -X begin-selection
@ -87,7 +97,7 @@ $TMUX send-keys -X previous-word
$TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word
$TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "\$ym_bols[]{}\n ")" ] || exit 1
[ "$($TMUX show-buffer)" = "$(printf "\$ym_bols[]{}\n ")" ] || exit 1
# Test that `next-word-end` treats digits as letters
$TMUX send-keys -X next-word-end