moving vool_method to parfait
This commit is contained in:
26
test/fragments/test_adds.rb
Normal file
26
test/fragments/test_adds.rb
Normal file
@ -0,0 +1,26 @@
|
||||
#require_relative 'helper'
|
||||
|
||||
module Rubyx
|
||||
class TestRubyAdds < MiniTest::Test
|
||||
# include RubyxTests
|
||||
|
||||
def pest_ruby_adds
|
||||
@string_input = <<HERE
|
||||
def fibo( n)
|
||||
a = 0
|
||||
b = 1
|
||||
i = 1
|
||||
while( i < n ) do
|
||||
result = a + b
|
||||
a = b
|
||||
b = result
|
||||
i+= 1
|
||||
end
|
||||
return result
|
||||
end
|
||||
HERE
|
||||
@stdout = "Hello there"
|
||||
check
|
||||
end
|
||||
end
|
||||
end
|
@ -25,7 +25,7 @@ module MomCompile
|
||||
lst = Vool::VoolCompiler.compile as_test_main( input )
|
||||
assert_equal Parfait::Class , lst.clazz.class , input
|
||||
@method = lst.clazz.get_method(:main)
|
||||
assert @method
|
||||
assert_equal Parfait::VoolMethod , @method.class
|
||||
res = lst.to_mom( nil )
|
||||
#puts "#{res.class}"
|
||||
res.first
|
||||
@ -40,7 +40,7 @@ module MomCompile
|
||||
test = is
|
||||
while(test)
|
||||
# if we assert here, we get output pointing here. Without stack, not useful
|
||||
raise "Wrong class for #{index+1}, #{dump(is)}" if should[index] != test.class
|
||||
raise "Wrong class for #{index+1}, #{dump(is)}" if should[index] != test.class
|
||||
index += 1
|
||||
test = test.next
|
||||
end
|
||||
|
@ -33,7 +33,7 @@ module Vool
|
||||
def test_creates_method_in_class
|
||||
method = create_method
|
||||
assert method , "No method created"
|
||||
assert_equal Vool::VoolMethod , method.class
|
||||
assert_equal Parfait::VoolMethod , method.class
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user