<commit_before>use v6;

use Test;

# L<S32::Str/Str/=item length>

=begin pod

Various length tests (though "length" should not be used)

This does not adequately test .chars, which is language dependent
and needs more careful tests.

L<"http://www.unicode.org/unicode/reports/tr11/">

=end pod

plan 58;

eval_dies_ok('"moose".length', 'Str.length properly not implemented');

# string literals, for sanity

# L<S32::Str/Str/=item bytes>

#?rakudo 3 skip '.bytes not implemented'
is("".bytes,         0, "empty string");
is("moose".bytes,    5, "moose");
is(bytes(:string('station')),    7, "bytes works with named argument");
my $x = undef;
dies_ok { $x.bytes }, "undef.bytes fail()s";
# See thread "undef.chars" on p6l started by <NAME>:
# L<"http://www.nntp.perl.org/group/perl.perl6.language/22595"><commit_msg>length is not language dependent<commit_after>use v6;

use Test;

# L<S32::Str/Str/=item length>

=begin pod

Various length tests (though "length" should not be used)

Don't mismatch "length" with the "width" property for Unicode characters.

L<"http://www.unicode.org/unicode/reports/tr11/">

=end pod

plan 58;

eval_dies_ok('"moose".length', 'Str.length properly not implemented');

# string literals, for sanity

# L<S32::Str/Str/=item bytes>

#?rakudo 3 skip '.bytes not implemented'
is("".bytes,         0, "empty string");
is("moose".bytes,    5, "moose");
is(bytes(:string('station')),    7, "bytes works with named argument");
my $x = undef;
dies_ok { $x.bytes }, "undef.bytes fail()s";
# See thread "undef.chars" on p6l started by <NAME>:
# L<"http://www.nntp.perl.org/group/perl.perl6.language/22595">
{'fraction_non_alphanumeric': 0.1663597298956415, 'fraction_numerical': 0.024554941682013505, 'mean_word_length': 4.488215488215488, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2306938', 'n_tokens_mistral': 618, 'n_tokens_neox': 568, 'n_words': 166}