Commit e7410fd8 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2371 from take-cheeze/end_of_code

Add test for end-of-program marker.
parents 6459a984 0fffdd27
...@@ -30,3 +30,17 @@ assert '$0 value' do ...@@ -30,3 +30,17 @@ assert '$0 value' do
# one liner # one liner
assert_equal '"-e"', `./bin/mruby -e 'p $0'`.chomp assert_equal '"-e"', `./bin/mruby -e 'p $0'`.chomp
end end
assert '__END__', '8.6' do
script = Tempfile.new('test.rb')
script.write <<EOS
p 'test'
__END__ = 'fin'
p __END__
__END__
p 'legend'
EOS
script.flush
assert_equal "\"test\"\n\"fin\"\n", `./bin/mruby #{script.path}`
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