adds an all test, uncomment not implemented
This commit is contained in:
parent
16a378e3da
commit
b1893482ff
@ -1 +1 @@
|
|||||||
require_relative "fragments/test_all"
|
require_relative "virtual/test_all"
|
||||||
|
2
test/virtual/test_all.rb
Normal file
2
test/virtual/test_all.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
require_relative "test_basic"
|
||||||
|
require_relative "test_methods"
|
@ -9,7 +9,7 @@ def foo(x)
|
|||||||
5
|
5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = [Virtual::Method.new(:foo,[Ast::NameExpression.new(:x)],Virtual::SelfReference.new(),Virtual::IntegerConstant.new(5),Virtual::MethodEnter.new(nil))]
|
@output = [Virtual::Method.new(:foo,[Ast::NameExpression.new(:x)],Virtual::SelfReference.new(),Virtual::Integer,Virtual::MethodEnter.new(nil))]
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ def String.length(x)
|
|||||||
@length
|
@length
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = [Virtual::Method.new(:length,[Ast::NameExpression.new(:x)],Boot::BootClass.new(:String,:Object),Virtual::Reference,Virtual::MethodEnter.new(Virtual::FrameSend.new(:_get_instance_variable , [ Virtual::StringConstant.new('length')])))]
|
@output = [Virtual::Method.new(:length,[Ast::NameExpression.new(:x)],Boot::BootClass.new(:String,:Object),Virtual::Reference,Virtual::MethodEnter.new(nil))]
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -30,11 +30,11 @@ def foo(x)
|
|||||||
2 + 5
|
2 + 5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = [Virtual::Method.new(:foo,[Ast::NameExpression.new(:x)])]
|
@output = [Virtual::Method.new(:foo,[Ast::NameExpression.new(:x)],Virtual::SelfReference.new(),Virtual::Reference,Virtual::MethodEnter.new(Virtual::FrameSet.new(:abba,Virtual::IntegerConstant.new(5))))]
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_function_if
|
def ttest_function_if
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
def ofthen(n)
|
def ofthen(n)
|
||||||
if(0)
|
if(0)
|
||||||
@ -48,7 +48,7 @@ HERE
|
|||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_function_return
|
def ttest_function_return
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
def retvar(n)
|
def retvar(n)
|
||||||
i = 5
|
i = 5
|
||||||
@ -59,7 +59,7 @@ HERE
|
|||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_function_return_if
|
def ttest_function_return_if
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
def retvar(n)
|
def retvar(n)
|
||||||
if( n > 5)
|
if( n > 5)
|
||||||
@ -73,7 +73,7 @@ HERE
|
|||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_function_return_while
|
def ttest_function_return_while
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
def retvar(n)
|
def retvar(n)
|
||||||
while( n > 5) do
|
while( n > 5) do
|
||||||
@ -86,7 +86,7 @@ HERE
|
|||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_function_while
|
def ttest_function_while
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
def fibonaccit(n)
|
def fibonaccit(n)
|
||||||
a = 0
|
a = 0
|
||||||
@ -100,7 +100,7 @@ HERE
|
|||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_function_big_while
|
def ttest_function_big_while
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
def fibonaccit(n)
|
def fibonaccit(n)
|
||||||
a = 0
|
a = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user