diff options
Diffstat (limited to 'ext/arybase/t/substr.t')
-rw-r--r-- | ext/arybase/t/substr.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/arybase/t/substr.t b/ext/arybase/t/substr.t new file mode 100644 index 0000000000..793293be8b --- /dev/null +++ b/ext/arybase/t/substr.t @@ -0,0 +1,22 @@ +use warnings; +use strict; + +use Test::More tests => 6; + +our $t; + +$[ = 3; + +$t = "abcdef"; +is substr($t, 5), "cdef"; +is $t, "abcdef"; + +$t = "abcdef"; +is substr($t, 5, 2), "cd"; +is $t, "abcdef"; + +$t = "abcdef"; +is substr($t, 5, 2, "xyz"), "cd"; +is $t, "abxyzef"; + +1; |