Open aw-was-here opened 9 years ago
I'm running into a similar issue, albeit with a simpler reproduction:
@test "Bad array subscript" {
now="$(date)"
ts="$((now - 3600))" # 1 hour old
}
Will throw:
not ok 3 Bad array subscript
/usr/local/libexec/bats-exec-test: line 258: BATS_ERROR_STACK_TRACE: bad array subscript
(note: of course, this fails because $(date)
isn't actually an integer, but arguably that should cause the test to fail, not crash the test runner)
I've got a unit test I'm writing that is causing bats to crash on OS X Mavericks (bash 3.2.53) with a bad subscript. Some sketchy variable handling in the routine being tested is causing bash to throw up. Here's the relevant code in its entirety: