changed marker
This commit is contained in:
parent
23e1b2519e
commit
cf00a6e490
@ -5,53 +5,53 @@ class TestBasic < MiniTest::Test
|
|||||||
|
|
||||||
def test_number
|
def test_number
|
||||||
@string_input = '42 '
|
@string_input = '42 '
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 42_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 42RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_true
|
def test_true
|
||||||
@string_input = 'true '
|
@string_input = 'true '
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::TrueValue {}_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::TrueValue {}RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
def test_false
|
def test_false
|
||||||
@string_input = 'false '
|
@string_input = 'false '
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::FalseValue {}_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::FalseValue {}RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
def test_nil
|
def test_nil
|
||||||
@string_input = 'nil '
|
@string_input = 'nil '
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::NilValue {}_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::NilValue {}RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_name
|
def test_name
|
||||||
@string_input = 'foo '
|
@string_input = 'foo '
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::Return_MY_MY_MARKER name: :return_MY_MY_MARKER type: !ruby/class 'Virtual::Mystery'_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::ReturnRETURN_MARKER name: :returnRETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_self
|
def test_self
|
||||||
@string_input = 'self '
|
@string_input = 'self '
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::Self_MY_MY_MARKER name: :self_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::SelfRETURN_MARKER name: :selfRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_instance_variable
|
def test_instance_variable
|
||||||
@string_input = '@foo_bar '
|
@string_input = '@foo_bar '
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::Return_MY_MY_MARKER name: :return_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::ReturnRETURN_MARKER name: :returnRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_module_name
|
def test_module_name
|
||||||
@string_input = 'FooBar '
|
@string_input = 'FooBar '
|
||||||
@output = "---_MY_MY_MARKER- &1 !ruby/object:Boot::BootClass_MY_MY_MARKER method_definitions: []_MY_MY_MARKER name: :FooBar_MY_MY_MARKER super_class_name: :Object_MY_MY_MARKER meta_class: !ruby/object:Boot::MetaClass_MY_MY_MARKER layout: !ruby/object:Virtual::Layout_MY_MY_MARKER members: []_MY_MY_MARKER functions: []_MY_MY_MARKER me_self: *1_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- &1 !ruby/object:Boot::BootClassRETURN_MARKER method_definitions: []RETURN_MARKER name: :FooBarRETURN_MARKER super_class_name: :ObjectRETURN_MARKER meta_class: !ruby/object:Boot::MetaClassRETURN_MARKER layout: !ruby/object:Virtual::LayoutRETURN_MARKER members: []RETURN_MARKER functions: []RETURN_MARKER me_self: *1RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_string
|
def test_string
|
||||||
@string_input = "\"hello\""
|
@string_input = "\"hello\""
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::StringConstant_MY_MY_MARKER string: hello_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::StringConstantRETURN_MARKER string: helloRETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ def foo(x)
|
|||||||
5
|
5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :foo_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::Argument_MY_MY_MARKER name: :x_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER locals: []_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: !ruby/object:Virtual::SelfReference_MY_MY_MARKER clazz: _MY_MY_MARKER return_type: !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 5_MY_MY_MARKER start: &1 !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: _MY_MY_MARKER current: *1_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :fooRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :xRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 5RETURN_MARKER start: &1 !ruby/object:Virtual::MethodEnterRETURN_MARKER next: RETURN_MARKER current: *1RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ def String.length(x)
|
|||||||
@length
|
@length
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :length_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::Argument_MY_MY_MARKER name: :x_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER locals: []_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: &4 !ruby/object:Boot::BootClass_MY_MY_MARKER method_definitions:_MY_MY_MARKER - !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :get_MY_MY_MARKER args:_MY_MY_MARKER - &1 !ruby/class 'Virtual::Integer'_MY_MY_MARKER locals: []_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: *1_MY_MY_MARKER return_type: *1_MY_MY_MARKER start: &2 !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: _MY_MY_MARKER current: *2_MY_MY_MARKER - !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :set_MY_MY_MARKER args:_MY_MY_MARKER - *1_MY_MY_MARKER - *1_MY_MY_MARKER locals: []_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: *1_MY_MY_MARKER return_type: *1_MY_MY_MARKER start: &3 !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: _MY_MY_MARKER current: *3_MY_MY_MARKER name: :String_MY_MY_MARKER super_class_name: :Object_MY_MY_MARKER meta_class: !ruby/object:Boot::MetaClass_MY_MY_MARKER layout: !ruby/object:Virtual::Layout_MY_MY_MARKER members: []_MY_MY_MARKER functions: []_MY_MY_MARKER me_self: *4_MY_MY_MARKER return_type: !ruby/object:Virtual::Return_MY_MY_MARKER name: :return_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER start: !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: &5 !ruby/object:Virtual::ObjectGet_MY_MY_MARKER next: _MY_MY_MARKER name: :length_MY_MY_MARKER current: *5_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :lengthRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :xRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: &4 !ruby/object:Boot::BootClassRETURN_MARKER method_definitions:RETURN_MARKER - !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :getRETURN_MARKER args:RETURN_MARKER - &1 !ruby/class 'Virtual::Integer'RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: *1RETURN_MARKER return_type: *1RETURN_MARKER start: &2 !ruby/object:Virtual::MethodEnterRETURN_MARKER next: RETURN_MARKER current: *2RETURN_MARKER - !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :setRETURN_MARKER args:RETURN_MARKER - *1RETURN_MARKER - *1RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: *1RETURN_MARKER return_type: *1RETURN_MARKER start: &3 !ruby/object:Virtual::MethodEnterRETURN_MARKER next: RETURN_MARKER current: *3RETURN_MARKER name: :StringRETURN_MARKER super_class_name: :ObjectRETURN_MARKER meta_class: !ruby/object:Boot::MetaClassRETURN_MARKER layout: !ruby/object:Virtual::LayoutRETURN_MARKER members: []RETURN_MARKER functions: []RETURN_MARKER me_self: *4RETURN_MARKER return_type: !ruby/object:Virtual::ReturnRETURN_MARKER name: :returnRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER start: !ruby/object:Virtual::MethodEnterRETURN_MARKER next: &5 !ruby/object:Virtual::ObjectGetRETURN_MARKER next: RETURN_MARKER name: :lengthRETURN_MARKER current: *5RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ def foo(x)
|
|||||||
2 + 5
|
2 + 5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output ="---_MY_MY_MARKER- !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :foo_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::Argument_MY_MY_MARKER name: :x_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER locals:_MY_MY_MARKER - !ruby/object:Virtual::Local_MY_MY_MARKER name: :abba_MY_MY_MARKER type: &1 !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 5_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: !ruby/object:Virtual::SelfReference_MY_MY_MARKER clazz: _MY_MY_MARKER return_type: !ruby/object:Virtual::Return_MY_MY_MARKER name: :return_MY_MY_MARKER type: !ruby/class 'Virtual::Mystery'_MY_MY_MARKER start: !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: !ruby/object:Virtual::FrameSet_MY_MY_MARKER next: !ruby/object:Virtual::LoadSelf_MY_MY_MARKER next: &2 !ruby/object:Virtual::FrameSend_MY_MY_MARKER next: _MY_MY_MARKER name: :+_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 5_MY_MY_MARKER value: !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 2_MY_MY_MARKER name: :abba_MY_MY_MARKER value: *1_MY_MY_MARKER current: *2_MY_MY_MARKER"
|
@output ="---RETURN_MARKER- !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :fooRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :xRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals:RETURN_MARKER - !ruby/object:Virtual::LocalRETURN_MARKER name: :abbaRETURN_MARKER type: &1 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 5RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: !ruby/object:Virtual::ReturnRETURN_MARKER name: :returnRETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER start: !ruby/object:Virtual::MethodEnterRETURN_MARKER next: !ruby/object:Virtual::FrameSetRETURN_MARKER next: !ruby/object:Virtual::LoadSelfRETURN_MARKER next: &2 !ruby/object:Virtual::FrameSendRETURN_MARKER next: RETURN_MARKER name: :+RETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 5RETURN_MARKER value: !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 2RETURN_MARKER name: :abbaRETURN_MARKER value: *1RETURN_MARKER current: *2RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ def foo()
|
|||||||
2 + 5
|
2 + 5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :foo_MY_MY_MARKER args: []_MY_MY_MARKER locals: []_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: !ruby/object:Virtual::SelfReference_MY_MY_MARKER clazz: _MY_MY_MARKER return_type: !ruby/object:Virtual::Return_MY_MY_MARKER name: :return_MY_MY_MARKER type: !ruby/class 'Virtual::Mystery'_MY_MY_MARKER start: !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: !ruby/object:Virtual::LoadSelf_MY_MY_MARKER next: &1 !ruby/object:Virtual::FrameSend_MY_MY_MARKER next: _MY_MY_MARKER name: :+_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 5_MY_MY_MARKER value: !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 2_MY_MY_MARKER current: *1_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :fooRETURN_MARKER args: []RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: !ruby/object:Virtual::ReturnRETURN_MARKER name: :returnRETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER start: !ruby/object:Virtual::MethodEnterRETURN_MARKER next: !ruby/object:Virtual::LoadSelfRETURN_MARKER next: &1 !ruby/object:Virtual::FrameSendRETURN_MARKER next: RETURN_MARKER name: :+RETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 5RETURN_MARKER value: !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 2RETURN_MARKER current: *1RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ def ofthen(n)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :ofthen_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::Argument_MY_MY_MARKER name: :n_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER locals:_MY_MY_MARKER - !ruby/object:Virtual::Local_MY_MY_MARKER name: :isit_MY_MY_MARKER type: &2 !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 42_MY_MY_MARKER - &1 !ruby/object:Virtual::Local_MY_MY_MARKER name: :maybenot_MY_MY_MARKER type: &4 !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 667_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: !ruby/object:Virtual::SelfReference_MY_MY_MARKER clazz: _MY_MY_MARKER return_type: *1_MY_MY_MARKER start: !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: !ruby/object:Virtual::ImplicitBranch_MY_MY_MARKER next: !ruby/object:Virtual::FrameSet_MY_MY_MARKER next: &3 !ruby/object:Virtual::Label_MY_MY_MARKER next: _MY_MY_MARKER name: :if_merge_1_MY_MY_MARKER name: :isit_MY_MY_MARKER value: *2_MY_MY_MARKER name: :if_merge_1_MY_MY_MARKER other: !ruby/object:Virtual::FrameSet_MY_MY_MARKER next: *3_MY_MY_MARKER name: :maybenot_MY_MY_MARKER value: *4_MY_MY_MARKER current: *3_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :ofthenRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :nRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals:RETURN_MARKER - !ruby/object:Virtual::LocalRETURN_MARKER name: :isitRETURN_MARKER type: &2 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 42RETURN_MARKER - &1 !ruby/object:Virtual::LocalRETURN_MARKER name: :maybenotRETURN_MARKER type: &4 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 667RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: *1RETURN_MARKER start: !ruby/object:Virtual::MethodEnterRETURN_MARKER next: !ruby/object:Virtual::ImplicitBranchRETURN_MARKER next: !ruby/object:Virtual::FrameSetRETURN_MARKER next: &3 !ruby/object:Virtual::LabelRETURN_MARKER next: RETURN_MARKER name: :if_merge_1RETURN_MARKER name: :isitRETURN_MARKER value: *2RETURN_MARKER name: :if_merge_1RETURN_MARKER other: !ruby/object:Virtual::FrameSetRETURN_MARKER next: *3RETURN_MARKER name: :maybenotRETURN_MARKER value: *4RETURN_MARKER current: *3RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ def fibonaccit(n)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :fibonaccit_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::Argument_MY_MY_MARKER name: :n_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER locals:_MY_MY_MARKER - !ruby/object:Virtual::Local_MY_MY_MARKER name: :a_MY_MY_MARKER type: &6 !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 0_MY_MY_MARKER - &4 !ruby/object:Virtual::Local_MY_MY_MARKER name: :some_MY_MY_MARKER type: &5 !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 43_MY_MY_MARKER - &1 !ruby/object:Virtual::Local_MY_MY_MARKER name: :other_MY_MY_MARKER type: &3 !ruby/object:Virtual::Return_MY_MY_MARKER name: :return_MY_MY_MARKER type: !ruby/class 'Virtual::Mystery'_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: !ruby/object:Virtual::SelfReference_MY_MY_MARKER clazz: _MY_MY_MARKER return_type: *1_MY_MY_MARKER start: !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: !ruby/object:Virtual::FrameSet_MY_MY_MARKER next: &2 !ruby/object:Virtual::Label_MY_MY_MARKER next: !ruby/object:Virtual::FrameGet_MY_MY_MARKER next: !ruby/object:Virtual::ImplicitBranch_MY_MY_MARKER next: !ruby/object:Virtual::FrameSet_MY_MY_MARKER next: !ruby/object:Virtual::FrameGet_MY_MY_MARKER next: !ruby/object:Virtual::LoadSelf_MY_MY_MARKER next: !ruby/object:Virtual::FrameSend_MY_MY_MARKER next: !ruby/object:Virtual::FrameSet_MY_MY_MARKER next: *2_MY_MY_MARKER name: :other_MY_MY_MARKER value: *3_MY_MY_MARKER name: :*_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 4_MY_MY_MARKER value: *4_MY_MY_MARKER name: :some_MY_MY_MARKER name: :some_MY_MY_MARKER value: *5_MY_MY_MARKER name: :while_1_MY_MY_MARKER other: &7 !ruby/object:Virtual::Label_MY_MY_MARKER next: _MY_MY_MARKER name: :while_1_MY_MY_MARKER name: :n_MY_MY_MARKER name: while_start_MY_MY_MARKER name: :a_MY_MY_MARKER value: *6_MY_MY_MARKER current: *7_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :fibonaccitRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :nRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals:RETURN_MARKER - !ruby/object:Virtual::LocalRETURN_MARKER name: :aRETURN_MARKER type: &6 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 0RETURN_MARKER - &4 !ruby/object:Virtual::LocalRETURN_MARKER name: :someRETURN_MARKER type: &5 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 43RETURN_MARKER - &1 !ruby/object:Virtual::LocalRETURN_MARKER name: :otherRETURN_MARKER type: &3 !ruby/object:Virtual::ReturnRETURN_MARKER name: :returnRETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: *1RETURN_MARKER start: !ruby/object:Virtual::MethodEnterRETURN_MARKER next: !ruby/object:Virtual::FrameSetRETURN_MARKER next: &2 !ruby/object:Virtual::LabelRETURN_MARKER next: !ruby/object:Virtual::FrameGetRETURN_MARKER next: !ruby/object:Virtual::ImplicitBranchRETURN_MARKER next: !ruby/object:Virtual::FrameSetRETURN_MARKER next: !ruby/object:Virtual::FrameGetRETURN_MARKER next: !ruby/object:Virtual::LoadSelfRETURN_MARKER next: !ruby/object:Virtual::FrameSendRETURN_MARKER next: !ruby/object:Virtual::FrameSetRETURN_MARKER next: *2RETURN_MARKER name: :otherRETURN_MARKER value: *3RETURN_MARKER name: :*RETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 4RETURN_MARKER value: *4RETURN_MARKER name: :someRETURN_MARKER name: :someRETURN_MARKER value: *5RETURN_MARKER name: :while_1RETURN_MARKER other: &7 !ruby/object:Virtual::LabelRETURN_MARKER next: RETURN_MARKER name: :while_1RETURN_MARKER name: :nRETURN_MARKER name: while_startRETURN_MARKER name: :aRETURN_MARKER value: *6RETURN_MARKER current: *7RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ def retvar(n)
|
|||||||
return i
|
return i
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = "---_MY_MY_MARKER- !ruby/object:Virtual::MethodDefinition_MY_MY_MARKER name: :retvar_MY_MY_MARKER args:_MY_MY_MARKER - !ruby/object:Virtual::Argument_MY_MY_MARKER name: :n_MY_MY_MARKER type: !ruby/object:Virtual::Mystery {}_MY_MY_MARKER locals:_MY_MY_MARKER - !ruby/object:Virtual::Local_MY_MY_MARKER name: :i_MY_MY_MARKER type: &1 !ruby/object:Virtual::IntegerConstant_MY_MY_MARKER integer: 5_MY_MY_MARKER tmps: []_MY_MY_MARKER receiver: !ruby/object:Virtual::SelfReference_MY_MY_MARKER clazz: _MY_MY_MARKER return_type: !ruby/object:Virtual::Reference_MY_MY_MARKER clazz: _MY_MY_MARKER start: !ruby/object:Virtual::MethodEnter_MY_MY_MARKER next: &2 !ruby/object:Virtual::FrameSet_MY_MY_MARKER next: _MY_MY_MARKER name: :i_MY_MY_MARKER value: *1_MY_MY_MARKER current: *2_MY_MY_MARKER"
|
@output = "---RETURN_MARKER- !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :retvarRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :nRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals:RETURN_MARKER - !ruby/object:Virtual::LocalRETURN_MARKER name: :iRETURN_MARKER type: &1 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 5RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: !ruby/object:Virtual::ReferenceRETURN_MARKER clazz: RETURN_MARKER start: !ruby/object:Virtual::MethodEnterRETURN_MARKER next: &2 !ruby/object:Virtual::FrameSetRETURN_MARKER next: RETURN_MARKER name: :iRETURN_MARKER value: *1RETURN_MARKER current: *2RETURN_MARKER"
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ module VirtualHelper
|
|||||||
machine = Virtual::Machine.new
|
machine = Virtual::Machine.new
|
||||||
main = Virtual::MethodDefinition.main
|
main = Virtual::MethodDefinition.main
|
||||||
expressions = parts.compile(machine.frame , main )
|
expressions = parts.compile(machine.frame , main )
|
||||||
should = YAML.load(@output.gsub("_MY_MY_MARKER" , "\n"))
|
should = YAML.load(@output.gsub("RETURN_MARKER" , "\n"))
|
||||||
assert_equal should , expressions , expressions.to_yaml.gsub("\n" , "_MY_MY_MARKER") + "\n" + expressions.to_yaml
|
assert_equal should , expressions , expressions.to_yaml.gsub("\n" , "RETURN_MARKER") + "\n" + expressions.to_yaml
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user