From f84c8cb19079cbfe2b5433a7b3e1eca4eae3ef22 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 15 Jun 2007 03:18:12 +0000 Subject: * sample/test.rb: fix to show line information whether test succeeds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sample/test.rb') diff --git a/sample/test.rb b/sample/test.rb index da44b180f3..18c914d5b3 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -14,10 +14,10 @@ end def test_ok(cond,n=1) $testnum+=1 $ntest+=1 + where = (st = caller(n)) ? st[0] : "caller error! (n=#{n}, trace=#{caller(0).join(', ')}" if cond - printf "ok %d\n", $testnum + printf "ok %d (%s)\n", $testnum, where else - 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 -- cgit v1.2.3