swig/Examples/test-suite/ruby/lib_std_string_runme.rb
Logan Johnson 56e34f6d39 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4477 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-08 04:51:15 +00:00

33 lines
757 B
Ruby

require 'lib_std_string'
include Lib_std_string
# Checking expected use of %typemap(in) std::string {}
test_value_in("Fee")
# Checking expected result of %typemap(out) std::string {}
raise RuntimeError unless test_value_in("Fi") == "Fi"
# Verify type-checking for %typemap(in) std::string {}
exceptionRaised = false
begin
test_value_in(0)
rescue TypeError
exceptionRaised = true
ensure
raise RuntimeError unless exceptionRaised
end
# Checking expected use of %typemap(in) const std::string & {}
test_const_reference_in("Fo")
# Verify type-checking for %typemap(in) const std::string & {}
exceptionRaised = false
begin
test_const_reference_in(0)
rescue TypeError
exceptionRaised = true
ensure
raise RuntimeError unless exceptionRaised
end