swig/Examples/test-suite/perl5/catches_strings_runme.pl
William S Fulton ed333b6b97 std::string throws typemaps
Go, Guile, Racket, Scilab: Add throws typemaps for std::string so that
thrown string exception messages can be seen.

Test all language for std::string throws typemaps
2022-09-19 09:09:29 +01:00

15 lines
380 B
Perl

use strict;
use warnings;
use Test::More tests => 4;
BEGIN { use_ok('catches_strings') }
require_ok('catches_strings');
eval {
catches_strings::StringsThrower::charstring();
};
like($@, qr/\bcharstring message/, "Should have thrown an exception");
eval {
catches_strings::StringsThrower::stdstring();
};
like($@, qr/\bstdstring message/, "Should have thrown an exception");