clearer organization for compiler tests
was slightly messy with small/large now needed different test for expression and statements
This commit is contained in:
23
test/compiler/fragments/test_putint.rb
Normal file
23
test/compiler/fragments/test_putint.rb
Normal file
@ -0,0 +1,23 @@
|
||||
require_relative 'helper'
|
||||
|
||||
class TestPutint < MiniTest::Test
|
||||
include Fragments
|
||||
|
||||
def test_putint
|
||||
@string_input = <<HERE
|
||||
class Integer
|
||||
int putint()
|
||||
return 1
|
||||
end
|
||||
end
|
||||
class Object
|
||||
int main()
|
||||
42.putint()
|
||||
end
|
||||
end
|
||||
HERE
|
||||
@expect = [ [Virtual::MethodEnter,Virtual::Set,Register::GetSlot,Virtual::Set,
|
||||
Virtual::Set,Virtual::MethodCall] ,[Virtual::MethodReturn] ]
|
||||
check
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user