Added a runtime test case for aggregate.i.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5327 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fac1ef0de3
commit
28209b817e
1 changed files with 26 additions and 0 deletions
26
Examples/test-suite/ruby/aggregate_runme.rb
Normal file
26
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