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:
Logan Johnson 2003-11-17 20:22:33 +00:00
commit 0ad9f49652

View 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