diff --git a/dfx.json b/dfx.json index b6e6f8f..cd486fb 100644 --- a/dfx.json +++ b/dfx.json @@ -13,4 +13,4 @@ }, "output_env_file": ".env", "version": 1 -} \ No newline at end of file +} diff --git a/src/parsekoto_backend/tests/hello_test.sh b/src/parsekoto_backend/tests/hello_test.sh new file mode 100755 index 0000000..434a97b --- /dev/null +++ b/src/parsekoto_backend/tests/hello_test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# ANSI color codes for green and red +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# Test the greet function +RESPONSE=$(dfx canister call parsekoto_backend greet '("ICP")') + +# Verify the result +EXPECTED='"Hello, ICP!"' +if [[ "$RESPONSE" == *"$EXPECTED"* ]]; then + echo -e "${GREEN}Test passed: $RESPONSE${NC}" +else + echo -e "${RED}Test failed: Expected $EXPECTED but got $RESPONSE${NC}" + exit 1 +fi +