Merge pull request #2371 from take-cheeze/end_of_code

Add test for end-of-program marker.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-06-07 23:17:42 +09:00
+14
View File
@@ -30,3 +30,17 @@ assert '$0 value' do
# one liner
assert_equal '"-e"', `./bin/mruby -e 'p $0'`.chomp
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