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:
parent
8199b93d1d
commit
6b6b041b64
3 changed files with 45 additions and 24 deletions
|
|
@ -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();"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue