diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cca631..f4fbfc3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,4 +9,6 @@ jobs: steps: - uses: actions/checkout@v3 - name: All test - run: bash -xv ./test.bash + run: | + bash -xv ./test.bash + bash -xv ./morse_test.bash diff --git a/morse b/morse index 488728a..371cbb5 100755 --- a/morse +++ b/morse @@ -1,4 +1,5 @@ #!/usr/bin/python3 + # SPDX-FileCopyrightText: 2024 Junya Wada # SPDX-License-Identifier: GPL-3.0-only diff --git a/morse_test.bash b/morse_test.bash new file mode 100755 index 0000000..a257c06 --- /dev/null +++ b/morse_test.bash @@ -0,0 +1,18 @@ +#!/bin/bash -xv +# SPDX-FileCopyrightText: 2024 Junya Wada +# SPDX-License-Identifier: GPL-3.0-only + +ng(){ + echo ${1}行目が違う + res=1 +} + +res = 0 + +out=$(echo "a" | ./morse) +[ "${out}" = "・ー" ] || ng "$LINENO" + + +[ "$res" = 0 ] && echo OK + +exit $res