ext/XS-APItest/t/swaplabel.t test recursive descent label parsing
ext/XS-APItest/t/swaptwostmts.t test recursive descent statement parsing
ext/XS-APItest/t/temp_lv_sub.t XS::APItest: tests for lvalue subs returning temps
+ext/XS-APItest/t/underscore_length.t Test find_rundefsv()
ext/XS-APItest/t/utf16_to_utf8.t Test behaviour of utf16_to_utf8{,reversed}
ext/XS-APItest/t/utf8.t Tests for code in utf8.c
ext/XS-APItest/t/xs_special_subs_require.t for require too
OUTPUT:
RETVAL
+STRLEN
+underscore_length()
+PROTOTYPE:
+PREINIT:
+ SV *u;
+ U8 *pv;
+ STRLEN bytelen;
+CODE:
+ u = find_rundefsv();
+ pv = (U8*)SvPV(u, bytelen);
+ RETVAL = SvUTF8(u) ? utf8_length(pv, pv+bytelen) : bytelen;
+OUTPUT:
+ RETVAL
+
MODULE = XS::APItest PACKAGE = XS::APItest::Magic
PROTOTYPES: DISABLE
--- /dev/null
+use warnings;
+use strict;
+
+use Test::More tests => 4;
+
+use XS::APItest qw(underscore_length);
+
+$_ = "foo";
+is underscore_length(), 3;
+
+$_ = "snowman \x{2603}";
+is underscore_length(), 9;
+
+my $_ = "xyzzy";
+is underscore_length(), 5;
+
+$_ = "pile of poo \x{1f4a9}";
+is underscore_length(), 13;
+
+1;