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