summaryrefslogtreecommitdiff
path: root/sample/test.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-16 13:12:24 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-16 13:12:24 +0000
commit571f22f5fe3fd3e265512c0e9ee4720482443301 (patch)
treede246e154a39f173491d53dfed39b4ffe2615e18 /sample/test.rb
parent48442d46b39976ec9a3a17e357fd3be13cd8feaf (diff)
* compile.c (iseq_compile_each): fix next/redo stack consistency.
[ruby-dev:31373] * bootstraptest/test_syntax.rb: add tests for above. * sample/test.rb: fix to use __FILE__ instead of $0 to know basedir. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 6dffa609dc..768429d951 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1871,13 +1871,14 @@ File.unlink "script_tmp" or `/bin/rm -f "script_tmp"`
File.unlink "script_tmp.bak" or `/bin/rm -f "script_tmp.bak"`
$bad = false
-if (dir = File.dirname(File.dirname($0))) == '.'
+if (dir = File.dirname(File.dirname(__FILE__))) == '.'
dir = ""
else
dir << "/"
end
def valid_syntax?(code, fname)
+ p fname
eval("BEGIN {return true}\n#{code}", nil, fname, 0)
rescue Exception
STDERR.puts $!.message