go_winter_work_2025/bash/train_bash/task2.sh

16 lines
293 B
Bash
Executable File

#!/bin/bash
arg1_test=( 2 -3 5 -7 -200 5 -1 -1 )
arg2_test=( 2 3 4 5 100 0 -1 -23 )
result=( 4 0 10 -2 -100 5 -2 -24 )
for i in ${!arg1_test[@]}
do
output=$(./summ ${arg1_test[$i]} ${arg2_test[$i]})
if [ $output -eq ${result[$i]} ]; then
echo "PASS"
else
echo "FAIL"
fi
done