From 2d0794bbec45bab6a6a79d93014f4d8333303840 Mon Sep 17 00:00:00 2001 From: whaffman Date: Thu, 6 Mar 2025 11:38:28 +0100 Subject: [PATCH] compare bash and minishell --- tests/test.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 tests/test.sh diff --git a/tests/test.sh b/tests/test.sh new file mode 100755 index 0000000..584a003 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +minishell_output=$(../minishell -c "$1") +minishell_exit_code=$? + +bash_output=$(bash -c "$1") +bash_exit_code=$? + +paste <(echo -e "Minishell:\n$minishell_output") <(echo -e "Bash:\n$bash_output") | column -t -s $'\t' +echo "Minishell exit code: $minishell_exit_code" +echo "Bash exit code: $bash_exit_code" + +if [ $minishell_exit_code -eq $bash_exit_code ]; then + echo "Exit codes match." +else + echo "Exit codes do not match." +fi \ No newline at end of file