From 71ab4a6c2d9864f91e82f4791cb2640b2f4a1b66 Mon Sep 17 00:00:00 2001 From: Leon Ding Date: Sun, 10 Sep 2023 22:23:06 +0800 Subject: [PATCH] fix: double quote to prevent globbing and word splitting. --- test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test.sh b/test.sh index 37e239d..4cc8145 100755 --- a/test.sh +++ b/test.sh @@ -18,13 +18,13 @@ if [ -z "$case_num" ]; then exit 1 fi -if [ $case_num -eq 1 ]; then +if [ ""$case_num"" -eq 1 ]; then cd cmd && go test -c && ./cmd.test -elif [ $case_num -eq 2 ]; then +elif [ "$case_num" -eq 2 ]; then echo "Testing conf package" -elif [ $case_num -eq 3 ]; then +elif [ "$case_num" -eq 3 ]; then echo "Testing server package" -elif [ $case_num -eq 4 ]; then +elif [ "$case_num" -eq 4 ]; then cd cmd && go test -c -race -coverprofile=coverage.txt -covermode=atomic -v ./cmd.test else