#!/usr/bin/env bats load test_helper @test "testing" { result="$(echo 2+2 | bc)" [ "$result" -eq 4 ] } @test "invoke with a single integer" { run problem-6.sh 2 assert_success $'squares: 4\nsum: 2' } @test "invoke with multiple integers" { run problem-6.sh 1 2 3 4 5 6 7 8 9 10 assert_success $'squares: 1 4 9 16 25 36 49 64 81 100\nsum: 55' } @test "invoke with single non-numeric" { run problem-6.sh "oops" assert_failure $'error: "oops" is not a number' } @test "invoke with multiple non-numeric" { run problem-6.sh "first" "second" assert_failure $'error: "first" is not a number\nerror: "second" is not a number' } @test "invoke with mixed numeric and non-numeric" { run problem-6.sh "oops" 10 "invalid" assert_failure $'error: "oops" is not a number\nerror: "invalid" is not a number' }