mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add test for end-of-program marker.
This commit is contained in:
committed by
Yukihiro "Matz" Matsumoto
parent
d75b84016c
commit
aa187956cf
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user