Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (22 sloc) 0.779 kb
use v6;
use Test;
# L<S32::Str/Str/"=item chop">
plan 6;
# Tests already covered by the specs
my $str = "foo";
is(chop($str), "fo", "o removed");
is($str, "foo", "original string unchanged");
is($str.chop, "fo", "o removed");
is($str, "foo", "original string unchanged");
is(chop("bar"), "ba", "chop on string literal");
is(chop(""), "", "chop on empty string literal");
# TODO: catch warning, what should be the return value ?
# my $undef_scalar;
# chop($undef_scalar)
# See L<"">:
# &chomp and &wrap are now nondestructive; chomp returns the chomped part,
# which can be defined by the filehandle that obtains the default string at
# the first place. To get destructive behaviour, use the .= form.
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.