{"atom":"regression/http-simple-cluster","family":"regression","slug":"http-simple-cluster","header":{"atom":"regression/http-simple-cluster","kind":"whole-program — a minimal repro, not yet reduced to an atom","source":"curated"},"axes":null,"cols":null,"engines":["rakudo-2026.07","rakupp-3.14.0"],"kinds":["ref","pp"],"defFrom":"rakupp:t/regression/http-simple-cluster.raku","counts":{"a":1,"f":0,"d":0,"c":0,"r":0,"n":0},"files":["atoms/regression/http-simple-cluster.grid"],"records":[["0001","","# Regression: the general interpreter fixes that came out of writing\n# HTTP::Simple for the ash/raku-modules repository, 2026-08-02. Both are\n# language bugs the module only happened to walk into; each expectation below\n# was checked against Rakudo.\n\nmy $ok = True;\nsub ck($got, $want, $l) { unless $got eqv $want { say \"FAIL: $l — {$got.raku} vs {$want.raku}\"; $ok = False } }\n\n# 1. `next without $x` — `without` was being read as the loop LABEL, so the\n#    NextEx carried a label no loop answered to and escaped to the top level\n#    (\"next without loop construct\"). The same went for `with`, and for `last`\n#    and `redo`.\n{\n    my @in = 1, Int, 3, Int, 5;\n    my @kept;\n    for @in -> $x { next without $x; @kept.push($x) }\n    ck(@kept, [1, 3, 5], 'next without $x skips the undefined ones');\n\n    my @until-undef;\n    for @in -> $x { last without $x; @until-undef.push($x) }\n    ck(@until-undef, [1], 'last without $x stops at the first undefined one');\n\n    my @defined-only;\n    for @in -> $x { next with $x; @defined-only.push('gap') }\n    ck(@defined-only, ['gap', 'gap'], 'next with $x keeps only the undefined ones');\n\n    # a real label still works, and still wins\n    my @pairs;\n    OUTER-LOOP: for 1, 2 -> $a {\n        for 10, 20 -> $b { next OUTER-LOOP if $b == 20; @pairs.push(\"$a-$b\") }\n    }\n    ck(@pairs, ['1-10', '2-10'], 'a labelled next still targets its loop');\n}\n\n# 2. `Buf.new($blob)` — a Blob is Positional, and the constructor was numifying\n#    it, so the buffer ended up holding the element COUNT as its single byte.\n{\n    my $src = Buf.new(1, 2, 3);\n    ck(Blob.new($src).list.List,   (1, 2, 3), 'Blob.new(Blob) copies the bytes');\n    ck(Buf.new($src).list.List,    (1, 2, 3), 'Buf.new(Blob) copies the bytes');\n    # only as the SOLE argument, though — a Blob is not a uint8\n    ck((try Buf.new($src, 4)).defined, False, 'a Blob among plain bytes is a type error');\n    ck(Blob.new('hi'.encode('utf8')).list.List, (104, 105), 'an encoded Str keeps its bytes');\n    ck(Buf.new(1, 2, 3).list.List, (1, 2, 3), 'plain byte arguments are unaffected');\n}\n\n# 3. the two together: splitting an HTTP response at the CRLFCRLF. It has to be\n#    done in BYTES — in a Raku string \"\\r\\n\" is one grapheme, so a character\n#    offset is out of step with the wire.\n{\n    my $raw = Buf.new(|\"HTTP/1.1 200 OK\\r\\nX: 1\\r\\n\\r\\n\".encode('utf8').list,\n                      |\"body\".encode('utf8').list);\n    my $sep;\n    loop (my $i = 0; $i + 4 <= $raw.elems; $i++) {\n        if $raw[$i] == 13 && $raw[$i+1] == 10 && $raw[$i+2] == 13 && $raw[$i+3] == 10 {\n            $sep = $i; last;\n        }\n    }\n    ck($sep.defined, True, 'the header terminator is found in the bytes');\n    ck(Blob.new($raw.subbuf($sep + 4)).decode('utf8'), 'body', 'and the body survives the split');\n}\n\nsay $ok ?? 'PASS' !! 'FAIL';","output PASS","a",["PASS","PASS"],0,[["budget","20s"]]]]}