emitting and testing protected methods for director protected members

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5512 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2003-12-09 10:38:34 +00:00
commit 6b6b041b64
3 changed files with 45 additions and 24 deletions

View file

@ -1,13 +1,21 @@
require 'director_protected'
NoProtectedError = Kernel.const_defined?("NoMethodError") ? NoMethodError : NameError
class FooBar < Director_protected::Bar
def ping
"FooBar::ping();"
end
protected
def ping
"FooBar::ping();"
end
end
b = Director_protected::Bar.new
fb = FooBar.new
begin
fb.ping
rescue NoProtectedError
end
raise RuntimeError if b.pong != "Bar::pong();Foo::pong();Bar::ping();"
raise RuntimeError if fb.pong != "Bar::pong();Foo::pong();FooBar::ping();"