{"atom":"regression/contextualizer-modifiers-and-dir","family":"regression","slug":"contextualizer-modifiers-and-dir","header":{"atom":"regression/contextualizer-modifiers-and-dir","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/contextualizer-modifiers-and-dir.raku","counts":{"a":0,"f":0,"d":0,"c":0,"r":1,"n":0},"files":["atoms/regression/contextualizer-modifiers-and-dir.grid"],"records":[["0001","","# Regression:\n#   1. Statement modifiers inside a sigil contextualizer — `@(EXPR for LIST)`,\n#      `@(EXPR if COND)`, `$(EXPR for LIST)` — used to be a parse error\n#      (\"expected ) got 'for'\"). JSON::Unmarshal's `@(_unmarshal($_, …) for @data)`\n#      needs it.\n#   2. `dir()` yields IO::Path entries (not Str), matching Rakudo — File::Find's\n#      `checkrules(IO::Path:D $io, …)` and any `.d`/`.IO` on the result need it.\n# Contract: exit 0 + last line PASS.\nmy @fail;\n\n# 1. contextualizer statement modifiers\n@fail.push(\"at-for (@(($_*2 for 1..3)).join(','))\")\n    unless @($_ * 2 for 1..3).Array eqv [2, 4, 6];  # .Array: eqv is type-aware\n@fail.push('at-if-true')  unless @(42 if True).elems == 1;\n@fail.push('at-if-false') unless @(42 if False).elems == 0;\n@fail.push('dollar-for')  unless $($_ + 1 for 1..3).List eqv (2, 3, 4);\n\n# 2. dir() returns IO::Path\n@fail.push('dir-iopath') unless dir('.').head ~~ IO::Path;\n# a :test matcher filters basenames\n@fail.push('dir-test') unless dir('.', test => /'.'/).elems > 0;\n\n# 3. File::Find works on top of dir() (finds a known file in src/)\n# Guarded with a RUNTIME require: File::Find is an ecosystem module, absent on a\n# clean CI runner. The old guard put `use` inside the try, which stopped working\n# when a failed `use` became a compile-time error — the file then died before\n# the try existed, on CI only (the module IS installed on the dev machine, which\n# is exactly how the gap hid locally). `require` fails at run time, catchably;\n# the rest of this file's checks keep running everywhere either way.\n{\n    my $n = try { require File::Find; find(dir => 'src', name => 'Value.h').elems };\n    with $n     { @fail.push(\"file-find ($n)\") unless $n == 1 }\n    else        { note '# File::Find not installed here — skipping find() check' }\n}\n\nif @fail { note \"FAILED: @fail[]\"; say 'FAIL' } else { say 'PASS' }","output PASS","r",["exit 1","FAIL"],{"v":"disputed","w":"the reference implementation does not satisfy the program's own contract here (exit 0 with a last line of PASS) — it needs modules that are not installed, or exercises something only one engine implements; there is no reference observation to rule against","d":"2026-08-14 against rakudo-2026.07"},[["budget","20s"]]]]}