Added a runtime test case for aggregate.i.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5327 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cffc4ed31a
commit
0ad9f49652
1 changed files with 26 additions and 0 deletions
26
SWIG/Examples/test-suite/ruby/aggregate_runme.rb
Normal file
26
SWIG/Examples/test-suite/ruby/aggregate_runme.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
require 'aggregate'
|
||||
|
||||
include Aggregate
|
||||
|
||||
# Confirm that move() returns correct results under normal use
|
||||
result = move(UP)
|
||||
raise RuntimeError unless (result == UP)
|
||||
|
||||
result = move(DOWN)
|
||||
raise RuntimeError unless (result == DOWN)
|
||||
|
||||
result = move(LEFT)
|
||||
raise RuntimeError unless (result == LEFT)
|
||||
|
||||
result = move(RIGHT)
|
||||
raise RuntimeError unless (result == RIGHT)
|
||||
|
||||
# Confirm that it raises an exception when the contract is violated
|
||||
failed = false
|
||||
begin
|
||||
move(0)
|
||||
rescue RuntimeError
|
||||
failed = true
|
||||
end
|
||||
raise RuntimeError unless failed
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue