aboutsummaryrefslogtreecommitdiffstats
path: root/sample/test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 7200ad41bf..da44b180f3 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -17,7 +17,7 @@ def test_ok(cond,n=1)
if cond
printf "ok %d\n", $testnum
else
- where = caller(n)[0]
+ where = (st = caller(n)) ? st[0] : "caller error! (n=#{n}, trace=#{caller(0).join(', ')}"
printf "not ok %s %d -- %s\n", $what, $testnum, where
$failed+=1
end