Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Krasimir committed Dec 1, 2024
1 parent 1a510e0 commit 4d9fd85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Binary file removed assignment
Binary file not shown.
24 changes: 8 additions & 16 deletions checkargs.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
#!/bin/bash

# Parameters
COMMAND="$1"
EXPECTED_OUTPUT="$2"
# Capture the command and expected output
program=$1
expected_output=$2

# Run the command and capture the output
ACTUAL_OUTPUT=$($COMMAND)
# Run the program and capture its output
output=$($program)

# Compare the actual output with the expected output
if [ "$ACTUAL_OUTPUT" == "$EXPECTED_OUTPUT" ]; then
echo "✅ Test passed!"
# Compare the output with the expected string
if [ "$output" == "$expected_output" ]; then
exit 0
else
echo "❌ Test failed!"
echo "Expected output:"
echo "================"
echo "$EXPECTED_OUTPUT"
echo "Actual output:"
echo "================"
echo "$ACTUAL_OUTPUT"
exit 1
fi
fi

0 comments on commit 4d9fd85

Please sign in to comment.