fix ruby class statement

This commit is contained in:
Torsten Ruger
2018-07-19 21:44:48 +03:00
parent 238f09b5ad
commit a5168ef818
3 changed files with 28 additions and 18 deletions

View File

@ -1,6 +1,27 @@
require_relative "helper"
module Ruby
class TestClassStatementVool < MiniTest::Test
include RubyTests
def setup
input = "class Tryout < Base;def meth; a = 5 ;end; end"
@vool = compile( input ).to_vool
end
def test_class
assert_equal Vool::ClassStatement , @vool.class
end
def test_body
assert_equal Vool::Statements , @vool.body.class
end
def test_compile_class_name
assert_equal :Tryout , @vool.name
end
def test_compile_class_super
assert_equal :Base , @vool.super_class_name
end
end
class TestEmptyClassStatement < MiniTest::Test
include RubyTests
@ -12,15 +33,12 @@ module Ruby
def test_compile_class
assert_equal ClassStatement , @lst.class
end
def test_compile_class_name
assert_equal :Tryout , @lst.name
end
def test_compile_class_super
assert_equal :Base , @lst.super_class_name
end
def test_compile_class_body
assert @lst.body.empty?
end