Commit 18718e06 authored by take_cheeze's avatar take_cheeze

Add test of $0 value in bin/mruby related to #2103 .

parent 9a10900a
......@@ -14,3 +14,19 @@ assert('regression for #1572') do
o = `bin/mruby -b #{bin.path}`.strip
assert_equal o, '"ok"'
end
assert '$0 value' do
script, bin = Tempfile.new('test.rb'), Tempfile.new('test.mrb')
# .rb script
script.write "p $0\n"
script.flush
assert_equal "\"#{script.path}\"", `./bin/mruby "#{script.path}"`.chomp
# .mrb file
`./bin/mrbc -o "#{bin.path}" "#{script.path}"`
assert_equal "\"#{bin.path}\"", `./bin/mruby -b "#{bin.path}"`.chomp
# one liner
assert_equal '"-e"', `./bin/mruby -e 'p $0'`.chomp
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment