diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-15 03:18:12 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-15 03:18:12 +0000 |
commit | f84c8cb19079cbfe2b5433a7b3e1eca4eae3ef22 (patch) | |
tree | 807830e267f978544cef832493b3904e7dc9ca72 /sample/test.rb | |
parent | d3be3d71022f091958b339e15d790e2d760ee576 (diff) |
* 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
Diffstat (limited to 'sample/test.rb')
-rw-r--r-- | sample/test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |