adds super

with and without args
current thinking is to fill the name of the method later as we carry no
context currently, but this may change
This commit is contained in:
Torsten Ruger
2017-04-02 18:42:52 +03:00
parent ac7b9138ff
commit 443fd13980
4 changed files with 42 additions and 0 deletions

View File

@ -36,5 +36,28 @@ module Vool
lst = Compiler.compile( "bar(1)")
assert_equal 1 , lst.arguments.first.value
end
def test_super0_receiver
lst = Compiler.compile( "super")
assert_equal SuperStatement , lst.receiver.class
end
def test_super0
lst = Compiler.compile( "super")
assert_equal SendStatement , lst.class
end
def test_super_receiver
lst = Compiler.compile( "super(1)")
assert_equal SuperStatement , lst.receiver.class
end
def test_super_args
lst = Compiler.compile( "super(1)")
assert_equal 1 , lst.arguments.first.value
end
def test_super_name #is nil
lst = Compiler.compile( "super(1)")
assert_nil lst.name
end
end
end