From dcee131cf01cc67e1a754ddbb49d0bf96dca191c Mon Sep 17 00:00:00 2001 From: Michele Sessa Date: Mon, 27 Mar 2023 18:58:33 +0100 Subject: [PATCH] refactor(division_test): make challenge function more modular --- sh/tests/division_test.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sh/tests/division_test.sh b/sh/tests/division_test.sh index d6990dbfe..28dc5a8fb 100755 --- a/sh/tests/division_test.sh +++ b/sh/tests/division_test.sh @@ -15,15 +15,8 @@ challenge() { return fi - # Test with one or two arguments - if [ $# -eq 1 ] - then - submitted=$(bash "$script_dirS"/student/division.sh $1) - expected=$(bash "$script_dirS"/solutions/division.sh $1) - else - submitted=$(bash "$script_dirS"/student/division.sh $1 $2) - expected=$(bash "$script_dirS"/solutions/division.sh $1 $2) - fi + submitted=$(bash "$script_dirS"/student/division.sh $@) + expected=$(bash "$script_dirS"/solutions/division.sh $@) diff <(echo "$submitted") <(echo "$expected") }