Raku Cases › Strings & Unicode

Strings & Unicode

Str methods, graphemes, normalization, encodings, Blob and Buf.

129 rules from 84 tests. 74 of those tests are confirmed on both engines: Raku++ and Rakudo 2026.11 both pass, or Raku++ gives Rakudo's answer on every probe of a family. The verdict is the test's, not each rule's. How to read a case.

6e-gatingRaku++ passesRakudo cannot run it2026-08-19 · 387d2c88
  1. 5

    The Format literal q:o/…/ and the Format/Formatter types exist only from 6.e.

    under 6.e my $f := q:o/%5s/; $f("foo") is foo and Formatter.new("%05d")(42) is 00042

  2. 15

    From 6.e :smartcase on .contains, .index and .substr-eq folds case only for a needle that carries no uppercase; before 6.e the adverb is ignored.

    under 6.e "Hello World".contains("world", :smartcase) is True and "hello world".contains("World", :smartcase) is False

  3. 16

    From 6.e .comb accepts a size => gap Pair; before 6.e that call does not resolve.

    "abcdefg".comb(2 => 1, :partial) is (ab de g) under 6.e

  4. 30

    The trans sub exists only from 6.e; it takes its pairs first and the target last, and transliterates a list target element by element.

    trans("a" => "b", "c" => "d", "abc") is bbd; trans("o" => "0", @w) with @w = "one","two" is (0ne tw0)

  5. 32

    The .nomark method exists only from 6.e and strips combining marks, on Cool values too.

    under 6.e "élan vitál".nomark is elan vital and 42.nomark is 42

  6. 34

    From 6.e .uniname on a codepoint that has no name fails; before 6.e it answers <unassigned>.

    0x110000.uniname is <unassigned> under 6.d and a Failure under 6.e

More from this test: Dates & times (2), Exceptions & control flow (1), Hashes & sets (3), I/O & processes (2), Lists & laziness (8), Numerics (1), Classes, roles & the MOP (2), Operators (1), Everything else (2), Regexes & grammars (2), Scoping & phasers (2), Signatures & dispatch (1), divergences (1).

allomorph-encodeRaku++ passesRakudo passes2026-09-10 · 1f8ebbc9
  1. 1

    .encode works on an allomorph and encodes its string side.

    <0x1F>.encode encodes 0x1F, not 31

  2. 2

    .encode on any Cool value stringifies it first.

async-socket-supply-and-decoderRaku++ passesRakudo passes2026-09-17 · 3c93d667
  1. 1

    Rakudo::Internals.NORMALIZE_ENCODING exists and answers the canonical spelling of an encoding name, the one Encoding::Registry.find is keyed by.

  2. 2

    A decoder's consume-available-chars holds back the bytes of an incomplete character, so a character split across two socket writes decodes intact.

    "ПИВО" split mid-character arrives as "ПИВО"

More from this test: Concurrency (2).

audited-language-gaps-2Raku++ passesRakudo passes2026-10-04 · 39c1aeb6
  1. 4

    \qw[…] and \qqw[…] inside a q string split into words, while Q stays raw.

  2. 10

    $?NL follows use newline, and a written \r\n stays CRLF under it.

More from this test: Compile-time errors (2), Containers & assignment (1), Dates & times (1), Lists & laziness (3), Operators (1), Regexes & grammars (2), Types & coercion (1).

audited-language-gaps-3Raku++ passesRakudo passes2026-10-04 · 74895f1e
  1. 1

    .contains($needle, $pos) counts $pos in graphemes.

More from this test: Hashes & sets (1), I/O & processes (1), Lists & laziness (1), Native types & NativeCall (1).

base-indent-count-is-cappedRaku++ passesRakudo passes2026-11-10 · 33adda5f
  1. 1

    .base's digit count and .indent's amount are refused when they exceed the number of graphemes a Str can hold.

    255.base(16, 99999999999) and "abc".indent(99999999999) are refused

blob-not-str-and-position-edgesRaku++ passesRakudo passes2026-10-21 · 5e474d7d
  1. 2

    .indices with a start position past the end of the string searches from there and finds nothing.

    "abc".indices("", 5) is empty

  2. 3

    .contains with a regex and a start position looks only from a character of the string, so a position at the string's end is False.

    "abc".contains(/$/, 3) is False

  3. 4

    .split with one Str needle and a limit answers a List where there is nothing to split: the string itself for a limit of 1, and ("",) or () for an empty string.

    "abc".split('', 1) is a List holding the string, not a Seq

More from this test: Types & coercion (1).

bson-simple-and-hash-agnosticRaku++ passesRakudo passes2026-08-31 · 2d04edb3
  1. 4

    Buf.splice accepts a Blob as its replacement and splices its bytes in, and the removed bytes come back as a buffer of the same type.

    buf8.new(1, 2, 3, 4).splice(1, 2).raku is Buf[uint8].new(2,3)

More from this test: Containers & assignment (4), Dates & times (1), Hashes & sets (1), Modules (1), Classes, roles & the MOP (2), Operators (1), Signatures & dispatch (2), Stringification (1), Types & coercion (1).

calls-rakudo-refusesRaku++ passesRakudo passes2026-11-14 · 6de9d27b · rakudo#2742
  1. 1

    substr given a Regex is refused.

  2. 4

    .chrs of an infinite list is refused.

More from this test: Concurrency (1), Classes, roles & the MOP (2).

case-subs-dispatch-as-methodsRaku++ passesRakudo passes2026-10-21 · 1918e400
  1. 1

    uc, lc, tc, chars and ord as subs call the method of that name on their argument, so they autothread over a junction and use an object's own method.

    uc("a"|"b") is not "ANY", and uc($obj) calls the object's own .uc

cat-assign-in-placeRaku++ passesRakudo passes2026-10-06 · 775a15e1 · #130
  1. 2

    ~= renormalizes the joined string as ~ does, so appending a combining mark to its base character yields one composed codepoint.

    "e" ~= "\x[301]" gives one codepoint (é)

char-positions-trans-continueRaku++ passesRakudo passes2026-10-21 · cce315ef
  1. 1

    .trans with a Regex key replaces at the matched characters also after a CR LF or a combining mark.

    "line1\r\nline2 x".trans(/x/ => "X") replaces the x, not the space before it

More from this test: Regexes & grammars (2).

chrs-refuses-non-codepointsRaku++ passesRakudo passes2026-11-10 · 3d5ae806
  1. 1

    chrs, as a sub and as a method, refuses an integer that is no codepoint, as chr does.

    chrs(65, -1) and (65, 0x110000).chrs are refused

crlf-is-one-grapheme-on-every-backendRaku++ passesRakudo passes2026-10-06 · d0698d82
  1. 1

    CR LF is one grapheme (UAX #29 GB3), so .chars, .comb, .flip, .substr and .index treat the pair as a single character.

    "a\r\nb".chars is 3

cro-install-engine-fixesRaku++ passesRakudo passes2026-10-10 · 29f5aa55
  1. 5

    Decoded text and program text are NFC.

    U+2126 OHM SIGN becomes U+03A9

More from this test: Concurrency (4), I/O & processes (1), Lists & laziness (1), Classes, roles & the MOP (1), Regexes & grammars (1), Signatures & dispatch (7), Syntax & parsing (2).

decoded-text-is-nfcRaku++ passesRakudo passes2026-10-21 · 1918e400
  1. 1

    Text decoded from a file, $*IN or a pipe is normalized to NFC.

    a line e\x[301]x read with .IO.lines or .slurp is eq "\x[e9]x"

  2. 2

    Text decoded as utf8-c8 keeps its bytes as they were instead of being normalized.

dot-twigil-needs-a-nameRaku++ passesRakudo passes2026-09-15 · 02003b9f
  1. 1

    In an interpolating string a . after a sigil is the public-attribute twigil only when an attribute name follows, so "%.{$n}g" keeps %. as literal text and interpolates the block.

    "%.{$n}g" builds a printf precision format, not "g"

exe-nfc-join-and-destructureRaku++ passesRakudo cannot run it2026-10-22 · 3e97932e
  1. 1

    ~ and string interpolation join two Strs in NFC across the seam.

    "e" ~ "\x[301]" is one code point

More from this test: Native types & NativeCall (1).

grand-review-b-parserRaku++ passesRakudo passes2026-09-06 · fa74f74f
  1. 4

    In a double-quoted string \c followed by decimal digits is the character with that codepoint, and malformed escapes such as \xZZ or \c[NO SUCH NAME] are errors rather than empty or NUL output. inferred

More from this test: Compile-time errors (3), Lists & laziness (1), Regexes & grammars (2), Signatures & dispatch (1), Syntax & parsing (5).

grand-review-c1-interpRaku++ passesRakudo passes2026-09-06 · fa74f74f
  1. 25

    .tc uses the Unicode titlecase mapping, so a titlecase digraph stays itself and the lowercase digraph maps to the titlecase one.

    "Dž".tc is Dž; "dž".tc is Dž

More from this test: Containers & assignment (1), Exceptions & control flow (3), I/O & processes (1), Numerics (7), Operators (4), Scoping & phasers (4), Signatures & dispatch (3), Stringification (1).

grand-review-c2-methodsRaku++ passesRakudo passes2026-09-06 · fa74f74f
  1. 5

    .chop and .indices count graphemes.

    "ax\x[301]".chop is a; "x\x[301]ab".indices("a") is (1,)

  2. 6

    .trim, .trim-leading and .trim-trailing strip every Unicode White_Space character, not only ASCII spaces.

    "\x[A0]a\x[A0]".trim is a

  3. 8

    .substr with a negative start or a negative length is out of range and dies; *-1 is the from-the-end form.

    "abc".substr(-1) dies; "abc".substr(*-1) is c

More from this test: Hashes & sets (1), I/O & processes (6), Lists & laziness (1), Numerics (4), Everything else (1).

grapheme-indexingRaku++ passesRakudo passes2026-07-29 · e955067e
  1. 1

    String positions are grapheme indices: substr, index, flip and substr-rw count graphemes, consistently with .chars, also when combining marks are present.

    $src.substr($i, 1) for $i below $src.chars stays inside a string like "h₂ŕ̥tḱos"

More from this test: Regexes & grammars (1).

grapheme-table-one-walkRaku++ passesRakudo passes2026-10-29 · 308aecdf · #179
  1. 2

    A string's characters are the grapheme clusters UAX #29 makes, for .chars, .index and .substr.

grapheme-units-split-rules-sprintfRaku++ passesRakudo passes2026-10-21 · 1918e400
  1. 1

    .split('') splits a string into graphemes, not codepoints.

    "a\r\nb".split('') keeps CR LF together as one piece

  2. 3

    sprintf's %.Ns precision and %Ns width count graphemes, not codepoints.

    sprintf("[%.1s]", "q\x[301]x") keeps the combining mark with its q

  3. 5

    The start position of .indices($needle, $pos) and .contains(/rx/, $pos) counts graphemes.

    "a\r\nbab".indices("b", 3) does not find the b at 2

More from this test: Regexes & grammars (1), Stringification (1).

guillemet-subscriptRaku++ passesRakudo does not pass2026-09-23 · f8296182
  1. 4

    "%h«a»" interpolates the subscripted element in a string, and qqww{$y} splits an interpolated value into words.

More from this test: Syntax & parsing (3).

hash-new-flatten-and-cool-encodeRaku++ passesRakudo passes2026-07-29 · 8b7a5485 · #12
  1. 2

    .decode validates UTF-8 and throws on malformed bytes, so (try $blob.decode) // $blob falls back to the blob.

  2. 3

    A List is Cool, so .encode on a List stringifies it first.

More from this test: Hashes & sets (1).

heredoc-positive-interpolation-adverbsRaku++ passesRakudo passes2026-09-15 · dcb882c0
  1. 1

    Positive interpolation adverbs on a q/Q heredoc are additive: q:s:to/END/ interpolates scalars and nothing else, and Q:c:s:to/END/ interpolates closures too.

  2. 2

    A negated adverb subtracts from qq: qq:!c:to/END/ interpolates variables but not blocks.

index-from-pos-nonasciiRaku++ passesRakudo passes2026-10-11 · c87cceb7 · #154
  1. 2

    .index and .rindex with a position count in graphemes and find the needle only on grapheme-cluster boundaries.

indices-comb-grapheme-boundaryRaku++ passesRakudo passes2026-10-19 · 9550aecc
  1. 1

    Str.indices and Str.comb(Str) do not find a needle that is only part of a grapheme — the \r or \n of a CRLF, a lone combining mark — as index, rindex, contains, split and subst do not.

indices-on-coolRaku++ passesRakudo passes2026-10-23 · 72e0c5fb
  1. 1

    .indices on a numeric Cool or a Bool reads the invocant as its Str.

    422.indices(2) is (1, 2)

  2. 2

    .indices dies when its needle is a type object, as .index does.

    42.indices: Str dies

interp-identifier-charsRaku++ passesRakudo passes2026-07-29 · e955067e
  1. 1

    A variable name interpolated in a string extends only over identifier characters (Unicode letters included), so a following symbol or emoji is literal text.

    "$v…" and "$v🙂" interpolate $v

interp-meta-mixin-block-sig-allomorphRaku++ passesRakudo passes2026-07-27 · e143336a
  1. 1

    A meta-method call with parentheses interpolates in a string, "$x.^name()", while without them "$x.^name" interpolates only $x.

More from this test: Lists & laziness (1), Classes, roles & the MOP (1), Regexes & grammars (1), Signatures & dispatch (1), Types & coercion (1), divergences (1).

interpolated-variable-lineRaku++ passesRakudo passes2026-11-08 · 728cf9cb
  1. 2

    $?LINE interpolated in a multi-line string or a heredoc is the line it is written on.

More from this test: Compile-time errors (1).

iospec-parts-and-numeric-identityRaku++ passesRakudo passes2026-07-27 · 5ee18c68
  1. 6

    .chomp removes one logical newline: \n, \r\n or a lone \r.

More from this test: I/O & processes (4), Lists & laziness (1), Numerics (1), Types & coercion (1).

issue-132-crlf-grapheme-string-opsRaku++ passesRakudo passes2026-10-06 · 5757eb09 · #132
  1. 1

    "\r\n" is one character for every string method: .contains, .split, literal .subst, .match, .starts-with, .ends-with and .trans find no "\r" or "\n" inside it.

  2. 2

    A Prepend codepoint such as U+0600 takes the next base into its grapheme, so string searches do not find that base on its own.

js-backend-framework-clusterRaku++ passesRakudo passes2026-09-13 · 862e3888
  1. 4

    .trans with a list on each side replaces whole strings pairwise rather than mapping the concatenated characters position by position. inferred

More from this test: Operators (1), Scoping & phasers (2), Signatures & dispatch (1), Syntax & parsing (2), Types & coercion (1).

json-codec-number-typing-and-nfcRaku++ passesRakudo passes2026-10-12 · 7e42ac3e
  1. 2

    A JSON string whose escape assembles a combining sequence decodes to NFC text.

    JSON "a\u0301" decodes to a Str equal to á

More from this test: Numerics (1).

json-fast-clusterRaku++ passesRakudo does not pass2026-08-05 · ddc75ad1
  1. 5

    .join composes combining marks with the preceding character (NFG).

    ("b", "a", 0x30A.chr).join.encode.bytes is 3

More from this test: Containers & assignment (1), Numerics (1), Operators (1), Signatures & dispatch (1), Types & coercion (6).

junction-interpolationRaku++ passesRakudo passes2026-07-30 · 5f8e831e
  1. 1

    Interpolating a Junction into a string autothreads the whole string.

    "Roots: $roots" for a junction of 3 and 1 is any(Roots: 3, Roots: 1)

More from this test: Operators (1).

keyof-capture-and-cool-subsRaku++ passesRakudo passes2026-07-27 · 4c35f546
  1. 4

    The words and lines subs are Cool routines that stringify a non-string argument.

    words(42) is "42".words

More from this test: Hashes & sets (1), Signatures & dispatch (2), Stringification (1).

lizmat-containers-and-dispatchRaku++ passesRakudo passes2026-09-13 · 3a8f2148
  1. 5

    .subst with a string needle treats a leading : in the needle as literal text, not as a regex adverb.

    .subst(':ver') and .subst(':x') look for those literal strings

More from this test: Hashes & sets (1), Classes, roles & the MOP (2), Signatures & dispatch (1), Syntax & parsing (1).

logical-newlinesRaku++ passesRakudo passes2026-08-26 · e25ccecb · #34
  1. 1

    .lines on a Str breaks on the whole logical-newline set — LF, CR, CRLF, FF, VT, NEL, LS, PS — and .chomp removes any of them.

    a lone CR ends a line

More from this test: Concurrency (1), I/O & processes (1).

method-argument-edgesRaku++ passesRakudo passes2026-11-09 · 6d62482c
  1. 2

    .words and .lines given a negative limit return nothing.

    .words(-1) and .lines(-1) are empty

More from this test: Numerics (1), divergences (1).

method-call-shapes-and-core-tablesRaku++ passesRakudo passes2026-10-04 · 1ae46f02
  1. 15

    A quoted argument of a method call interpolated in a string may hold a ).

More from this test: Containers & assignment (1), Numerics (1), Classes, roles & the MOP (9), Operators (1), Syntax & parsing (2).

missing-routines-batchRaku++ passesRakudo passes2026-07-26 · 8782278a
  1. 8

    The comb($matcher, $input) sub takes its arguments in the opposite order from the method.

More from this test: Dates & times (1), Hashes & sets (1), Lists & laziness (3), Regexes & grammars (1), Stringification (1).

module-page-sextetRaku++ passesRakudo passes2026-07-30 · 8de6c3a0
  1. 4

    Str.encode('utf-16') yields 16-bit code units, with surrogate pairs for characters beyond the BMP.

More from this test: Numerics (1), Classes, roles & the MOP (3), Regexes & grammars (7), Stringification (2).

naive-word-wrapper-wraps-at-71Raku++ passesRakudo passes2026-09-15 · 9ad1caac
  1. 1

    Str has a naive-word-wrapper method that word-wraps a text. inferred

needle-type-object-no-matchRaku++ passesRakudo passes2026-11-08 · c73d0b8d
  1. 1

    A type object where a needle goes — .index(Str), .indices(Str), .contains(Int) — is X::Multi::NoMatch.

    "abc".index(Str) dies with X::Multi::NoMatch

More from this test: Exceptions & control flow (1).

nfc-join-windowRaku++ passesRakudo does not pass2026-10-10 · 0467e49a
  1. 2

    Normalization and grapheme segmentation reach across a join made by ~, ~=, interpolation or .join: composition, marks that reorder, Hangul L+V / LV+T / L+VT, a composition whose second half is a starter, CR LF, emoji ZWJ sequences, skin tones and regional indicators split between the sides all come out as in the whole string.

    e joined with U+0301 composes; ȩ joined with U+0306 is ḝ

  2. 3

    The chrs(…) sub returns an NFC-normalized Str, as the .chrs method and chr do.

  3. 4

    ~ with an object operand joins the object's .Str and composes across the join.

More from this test: divergences (1).

nqp-sha1Raku++ passesRakudo passes2026-09-11 · cc95e49f
  1. 1

    nqp::sha1($str) answers the SHA-1 of the string's UTF-8 bytes as uppercase hex.

nqp-unipropcode-intRaku++ passesRakudo passes2026-10-10 · e1663c0c
  1. 1

    nqp::unipropcode answers the integer property code, which nqp::getuniprop_str, getuniprop_int, getuniprop_bool, unipvalcode, matchuniprop and hasuniprop take.

    nqp::unipropcode("Alphabetic") is 33 and nqp::unipropcode("General_Category") is 20

More from this test: divergences (1).

rakudo-t-language-gaps-1Raku++ passesRakudo passes2026-10-05 · 892e6c61
  1. 12

    CR LF is one grapheme.

More from this test: Compile-time errors (1), Containers & assignment (1), Lists & laziness (1), Classes, roles & the MOP (2), Operators (1), Everything else (1), Regexes & grammars (2), Scoping & phasers (2), Signatures & dispatch (1), Stringification (2), Syntax & parsing (1).

regex-class-members-and-match-varRaku++ passesRakudo passes2026-08-15 · 718614ae
  1. 2

    $/ takes a postfix like any other variable, in an interpolating string and in a substitution replacement.

    "$/[0]" is the first capture; s/…/$/[0]/ replaces the match with it

More from this test: Regexes & grammars (1).

roast-sweep-runtimeRaku++ passesRakudo cannot run it2026-09-28 · 2cc896bd
  1. 14

    sprintf autothreads over a Junction given as its format. inferred

More from this test: Compile-time errors (4), Concurrency (2), Containers & assignment (2), Exceptions & control flow (2), Hashes & sets (4), I/O & processes (3), Lists & laziness (5), Modules (2), Classes, roles & the MOP (8), Operators (4), Everything else (1), Regexes & grammars (1), Scoping & phasers (14), Stringification (1), Types & coercion (3).

samecase-ignoremark-graphemesRaku++ passesRakudo passes2026-10-23 · 9d48b3b5
  1. 1

    .samecase and s:ii/:samecase transfer case grapheme by grapheme, in any script.

    my $x = "e̲E̲"; $x ~~ s:ii/\w+/xy/ leaves xY

More from this test: Regexes & grammars (3).

slices-trans-and-exact-sequencesRaku++ passesRakudo passes2026-07-27 · 40bb85d6
  1. 5

    .trans cycles a shorter replacement side, and takes :squash (collapse a run of the same replacement) and :complement (translate everything the left side does not name).

  2. 6

    $s.substr-rw(from, len) = … splices into the string in place, and a zero length inserts.

More from this test: Hashes & sets (3), Lists & laziness (1), Regexes & grammars (1), Syntax & parsing (1).

socket-text-is-nfcRaku++ passesRakudo passes2026-10-21 · 5e474d7d
  1. 1

    Text read from a socket (IO::Socket::Async's Supply, IO::Socket::INET's .get, .lines and .recv) is normalized to NFC, while a :bin read and utf8-c8 keep their bytes.

    "e\x[301]x" off the wire is eq "\x[e9]x"

splice-rotor-rettype-and-placeholdersRaku++ passesRakudo passes2026-07-27 · d399d9a1
  1. 4

    $:name, the implicit named placeholder parameter, interpolates in a double-quoted string like any other twigilled variable.

More from this test: Hashes & sets (1), Lists & laziness (1), Signatures & dispatch (1).

split-adverbs-and-regex-valuesRaku++ passesRakudo passes2026-07-26 · 16eefbba
  1. 1

    .split with :v, :k, :kv or :p interleaves the separators with the pieces, where :k is the index of the matching delimiter within the delimiter list, so a single delimiter always reports 0.

  2. 2

    When .split keeps separators, a regex delimiter comes back as a Match and a literal one as a Str.

  3. 3

    .words($n) returns at most $n words; * or Inf means all of them.

More from this test: Regexes & grammars (1), Stringification (1).

split-zero-width-matchRaku++ passesRakudo passes2026-09-16 · 20bfd161
  1. 1

    Str.split on a regex that matches zero-width splits at that position without consuming the character there.

    splitting "YearBBS" at zero-width lookaround points loses no letter

str-ignorecase-and-indicesRaku++ passesRakudo passes2026-07-26 · 28a18e27
  1. 1

    .contains, .starts-with and .ends-with honour :i/:ignorecase, including a bare :i.

  2. 2

    .indices honours :i/:ignorecase and answers character positions, not byte offsets.

str-match-adverbs-and-substrRaku++ passesRakudo passes2026-07-26 · 3db5cacf
  1. 3

    .lines takes a limit, :count and :!chomp.

  2. 4

    The lines and words subs take their string even when a named argument precedes it.

    lines(:!chomp, "a\nb") splits the string instead of reading STDIN

  3. 5

    substr takes a Range, and a WhateverCode start and length as in substr($s, *-3, *-1), where a WhateverCode length counts from the end of the whole string.

  4. 6

    substr-eq takes :ignoremark, and .uniparse works as a method.

More from this test: Regexes & grammars (2).

str-position-and-ignoremarkRaku++ passesRakudo passes2026-07-26 · f3ea428d
  1. 1

    .contains($needle, $pos) and .indices($needle, $pos) begin searching at character position $pos.

  2. 2

    :ignoremark on the Str search routines compares base characters grapheme for grapheme, and the positions answered index the original string.

    "tête-à-tête".indices("te", :ignoremark) is 0, 2, 7, 9

  3. 3

    .unival of a character with no numeric value is NaN, not Nil, and .univals includes those NaNs.

  4. 4

    .encode($enc, :replacement) substitutes for every character the encoding cannot represent, and a bare :replacement means ?.

str-predicates-in-placeRaku++ passesRakudo passes2026-10-12 · 84af1cd0 · #154
  1. 2

    .starts-with, .ends-with and .contains match whole graphemes only — "\r\n" is one, as is a base with its combining marks — and count positions in graphemes.

str-range-consumersRaku++ passesRakudo passes2026-07-22 · 437647ae
  1. 2

    .trans flattens a Range side, and Range elements inside an array side such as ['a'..'c'], into individual characters.

More from this test: Hashes & sets (1), Stringification (1).

string-escape-past-last-codepointRaku++ passesRakudo passes2026-11-10 · 91f64325
  1. 2

    A \x[…] escape naming a surrogate codepoint is accepted.

More from this test: Compile-time errors (1).

string-escapes-c-x-oRaku++ passesRakudo passes2026-07-22 · 60a51a27
  1. 1

    In a double-quoted string the \c, \x and \o escapes (including bracket forms like \c[LINE FEED]) are valid and raise no X::Backslash::UnrecognizedSequence.

string-viewsRaku++ passesRakudo passes2026-10-06 · 895a370f · #130
  1. 2

    Concatenation normalizes across the join, so a base character and a following combining mark compose and CR followed by LF count as one grapheme. inferred

substr-out-of-range-hintRaku++ passesRakudo passes2026-11-08 · 8660ca95
  1. 1

    substr with a start past the end, or a negative start within the string's length, dies with a message ending in a hint to index from the end, while a negative start further back than the length gets no hint.

    "; use *-10 if you want to index relative to the end"

  2. 2

    substr with a negative length reports the "Number of characters argument" out of range, in 0..^Inf.

substr-start-and-lengthRaku++ passesRakudo passes2026-11-09 · b07f37e2
  1. 1

    .substr with a start past the end of the string fails with an out-of-range error whose hint is use *-N for the start N given.

    "abc".substr(10) hints "use *-10"

  2. 2

    .substr refuses a negative start instead of counting from the end.

    "abc".substr(-2) is refused

  3. 3

    A Callable length given to .substr is called with the number of characters left after the start.

    "abcd".substr(1, *-1) is "bc"

  4. 4

    .substr refuses a negative length, and a length of * or Inf takes the rest of the string. inferred

todo-small-divergences-2026-10-11Raku++ passesRakudo does not pass2026-10-11 · fc6abf32
  1. 3

    The Str case maps and counts called with an extra positional argument, as in "X".lc("a"), are arity errors.

More from this test: Containers & assignment (1), Classes, roles & the MOP (2), Operators (2), Scoping & phasers (1), Signatures & dispatch (2), Syntax & parsing (3), Types & coercion (4), divergences (1).

top100-roots-2026-09-02Raku++ passesRakudo does not pass2026-09-02 · 7af75847
  1. 25

    nqp::getuniprop_str and nqp::getuniprop_bool with a code from nqp::unipropcode answer Unicode properties, with string properties given as their short alias.

    nqp::getuniprop_str(0x61, nqp::unipropcode('East_Asian_Width')) is Na

  2. 29

    .Str on a utf8 buffer decodes it.

    "héllo".encode.Str is héllo

More from this test: Containers & assignment (1), Exceptions & control flow (2), Lists & laziness (1), Modules (1), Native types & NativeCall (3), Numerics (1), Classes, roles & the MOP (4), Regexes & grammars (3), Scoping & phasers (1), Stringification (1), Syntax & parsing (3), Types & coercion (6).

tr-non-mutatingRaku++ passesRakudo passes2026-08-20 · e3f76714 · rakudo#1551
  1. 1

    TR/// returns the transliterated string and leaves its target unchanged.

    TR/a..j/0..9/

  2. 2

    $x ~~ TR/// returns the transliterated $x.

    "ab" ~~ TR/ab/01/ is "01"

  3. 3

    A bare tr/// against $_ returns a StrDistance, which stringifies to the result and numifies to the count of changes.

tr-smartmatch-answers-the-stringRaku++ passesRakudo passes2026-11-13 · 6b709af5 · rakudo#1551
  1. 1

    $x ~~ TR/// answers the transliterated Str.

    'hello' ~~ TR/e/1/ is "h1llo"

More from this test: Stringification (1).

trans-named-adverbsRaku++ passesRakudo passes2026-10-03 · 72e93f3c · #120
  1. 1

    A named argument to Str.trans is never a mapping: :c, :s and :d (any truthy value, :delete(1) too) are options and other names are ignored.

    "Right grep".trans("\t" => " ", :g) leaves the letter g alone

trans-regex-keyRaku++ passesRakudo passes2026-08-27 · 023300db
  1. 1

    .trans with a Regex key replaces every match of the pattern.

    "a b".trans(/\s+/ => ' ') collapses the run of spaces to one

type-object-needle-and-signature-blobRaku++ passesRakudo passes2026-09-17 · 2e994990
  1. 1

    A type object as the needle of index, rindex, contains, starts-with or ends-with dies, since there is no candidate for (Cool:D: Str:U).

    42.ends-with(Str) dies

More from this test: Everything else (1).

unclear-reread-fixesRaku++ passesRakudo does not pass2026-11-14 · e2981dc5 · rakudo#4102
  1. 2

    .encode with an encoding name nothing knows throws X::Encoding::Unknown. inferred

    "中".encode("gbk") dies with "Unknown string encoding 'gbk'"

More from this test: Numerics (1), Operators (1).

uni-encode-is-a-bufRaku++ passesRakudo passes2026-11-11 · 1d8f1495 · #251
  1. 1

    .encode on a Uni, the four normal forms included, answers a Buf for every encoding it can do.

    $s.NFD.encode("utf8") ~~ Buf is True

  2. 2

    .encode on a Uni encodes its codepoints as they are, so an NFD stays decomposed.

unicode-num-sigma-fold-collateRaku++ passesRakudo passes2026-07-31 · e85866a4
  1. 2

    .lc applies Final_Sigma: a Σ preceded by a letter and not followed by one lowercases to ς, while mid-word and lone sigmas become σ.

  2. 4

    .collate sorts by the Unicode Collation Algorithm (DUCET).

More from this test: Numerics (1), Regexes & grammars (1).

unicode-version-and-nfgRaku++ passesRakudo passes2026-11-11 · fd3fda0f · #252
  1. 1

    Unicode.version answers a Version and Unicode.NFG a Bool, on the class and on an instance.

    Unicode.NFG is True

  2. 3

    Unicode.new makes an instance that carries version and NFG as attributes and shows them in its .raku. inferred

    Unicode.new(version => v18.0, NFG => Bool::True)

More from this test: divergences (1).

uniname-is-the-formal-nameRaku++ passesRakudo passes2026-10-06 · d0698d82
  1. 1

    .uniname answers the formal Unicode Name property of a codepoint, never a name alias or correction alias.

    .uniname of U+180E is not MVS, of U+FEFF not ZWNBSP, of U+2118 not WEIERSTRASS ELLIPTIC FUNCTION

  2. 2

    \c[…] and uniparse resolve Unicode name aliases as well as formal names.

    \c[MVS] and uniparse('ZWSP') resolve

uniprop-against-the-ucdRaku++ passesRakudo does not pass2026-10-14 · 32c91929
  1. 3

    uniprop Indic_Conjunct_Break (InCB) answers None, Linker, Consonant or Extend, not a Bool.

  2. 4

    uniprop Block of a code point outside every block is No_Block.

  3. 6

    A mapping uniprop answer and uniparse's answer are NFC Strs, equal to the same text made by chr or a literal.

    U+0340's lowercase equals U+0300; uniparse('GREEK QUESTION MARK') equals ;

More from this test: divergences (3).

utf8-c8-synthetic-stands-aloneRaku++ passesRakudo passes2026-10-06 · d0698d82
  1. 1

    A byte that utf8-c8 cannot decode is a synthetic grapheme of its own, broken around like a Control: a combining mark after it or a Prepend before it does not join it.

    the undecodable byte 0xFF followed by U+20E7 has .chars 2