From b2b13087549cfbf0ae64a738523b7521d1541b80 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Mon, 27 Sep 2021 10:11:56 -0400 Subject: [PATCH] Fix helloworld test to pass with 6.0 RC2 F# now uses a different hello world message. Also rename test to address #158 Fixes: https://github.com/redhat-developer/dotnet-regular-tests/issues/158 --- {helloworld-2x => helloworld}/test.json | 2 +- {helloworld-2x => helloworld}/test.sh | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) rename {helloworld-2x => helloworld}/test.json (85%) rename {helloworld-2x => helloworld}/test.sh (76%) diff --git a/helloworld-2x/test.json b/helloworld/test.json similarity index 85% rename from helloworld-2x/test.json rename to helloworld/test.json index a86357b..f32eb8b 100644 --- a/helloworld-2x/test.json +++ b/helloworld/test.json @@ -1,5 +1,5 @@ { - "name": "helloworld-2x", + "name": "helloworld", "enabled": true, "requiresSdk": true, "version": "2.0", diff --git a/helloworld-2x/test.sh b/helloworld/test.sh similarity index 76% rename from helloworld-2x/test.sh rename to helloworld/test.sh index 4a3dbaa..9de4d32 100755 --- a/helloworld-2x/test.sh +++ b/helloworld/test.sh @@ -7,9 +7,12 @@ PROJNAME=helloworld # Test new C# project dotnet new console --language C# --name $PROJNAME pushd $PROJNAME -dotnet run | grep 'Hello,\? World!' -if [ $? -eq 1 ]; then +if dotnet run | grep 'Hello,\? World!'; then + true +else echo "C# Hello World FAIL" + dotnet run + rm -rf $PROJNAME exit 1 fi popd @@ -23,9 +26,11 @@ echo -e "===================\n" dotnet new console --language F# --name $PROJNAME pushd $PROJNAME -dotnet run | grep -i 'Hello,\? World!\? from F#' -if [ $? -eq 1 ]; then +if dotnet run | grep -E 'Hello,? [Ww]orld!? from F#|Hello from F#'; then + true +else echo "F# Hello World FAIL" + dotnet run rm -rf $PROJNAME exit 1 fi @@ -40,9 +45,11 @@ echo -e "===================\n" dotnet new console --language VB --name $PROJNAME pushd $PROJNAME -dotnet run | grep 'Hello,\? World!' -if [ $? -eq 1 ]; then +if dotnet run | grep 'Hello,\? World!'; then + true +else echo "VB Hello World FAIL" + dotnet run rm -rf $PROJNAME exit 1 fi