swig/Examples/test-suite/ruby/aggregate_runme.rb
Gonzalo Garramuno 8742036cbd Removed macro stuff titles of author, copyright,
etc.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9785 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-05-06 18:02:24 +00:00

37 lines
612 B
Ruby

#!/usr/bin/env ruby
#
# Put description here
#
#
#
#
#
require 'swig_assert'
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