summaryrefslogtreecommitdiffstats
path: root/sample/test.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-15 03:18:12 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-15 03:18:12 +0000
commitfa304810e15a8c66f787561a472de02ee0ca9002 (patch)
tree807830e267f978544cef832493b3904e7dc9ca72 /sample/test.rb
parent9c82a16cb1393f7f9f177a783fddfe6ba937628a (diff)
downloadruby-fa304810e15a8c66f787561a472de02ee0ca9002.tar.gz
ruby-fa304810e15a8c66f787561a472de02ee0ca9002.tar.xz
ruby-fa304810e15a8c66f787561a472de02ee0ca9002.zip
* sample/test.rb: fix to show line information whether test succeeds.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/sample/test.rb b/sample/test.rb
index da44b180f..18c914d5b 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