adds method_statement to vool

This commit is contained in:
Torsten Ruger
2017-04-01 16:27:32 +03:00
parent 295782d9e6
commit 34fdf7b2cd
7 changed files with 55 additions and 1 deletions

View File

@ -20,5 +20,9 @@ module Vool
assert_equal :Base , @lst.super_class_name
end
def test_compile_class_body
assert_equal [] , @lst.body
end
end
end

View File

@ -1,2 +1,3 @@
require_relative "helper"
require_relative "test_class_statement"
require_relative "test_method_statement"

View File

@ -0,0 +1,28 @@
require_relative "../helper"
module Vool
class TestMethodStatement < MiniTest::Test
def setup
input = "def tryout(arg1, arg2) ; end "
@lst = Compiler.compile( input )
end
def test_compile_method
assert_equal MethodStatement , @lst.class
end
def test_compile_method_name
assert_equal :tryout , @lst.name
end
def test_compile_method_super
assert_equal [:arg1, :arg2] , @lst.args
end
def test_compile_method_body
assert_equal [] , @lst.body
end
end
end