From 4681afc9882cfa6da81d9e8afd0945513e4b61a8 Mon Sep 17 00:00:00 2001 From: Junya Wada Date: Wed, 27 Nov 2024 14:22:23 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A2=E3=83=BC=E3=83=AB=E3=82=B9=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=81=8C=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=99=E3=82=8B=E3=81=8B=E3=81=AE=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 4 +++- morse | 1 + morse_test.bash | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 morse_test.bash 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