✓
Passing This code compiles and runs correctly.
Code
// Pins that a koru.json `paths` key is matched as the LONGEST covering module
// path, on segment boundaries — not as the first path segment.
//
// `koru` and `koru/vaxis` both cover `koru/vaxis`; the specific key wins, so the
// import lands on the vendored tree. `koru/other` has no key of its own and
// still resolves through the shorter `koru`, which is what makes this a widening
// rather than a replacement: redirecting one module leaves its neighbours alone.
import std/io
import koru/vaxis
import koru/other
koru/vaxis:greet(): v |> std/io:print.ln("{{ v:s }}")
koru/other:greet(): o |> std/io:print.ln("{{ o:s }}")
Actual
VENDORED vaxis
REGISTRY other
Expected output
VENDORED vaxis
REGISTRY other
Flows
flow ~greet click a branch to expand · @labels scroll to their anchor
greet
flow ~greet click a branch to expand · @labels scroll to their anchor
greet
Imported Files
// A neighbour of vaxis inside the same namespace, with no key of its own. It
// must keep resolving through the shorter `koru` key.
~pub tor greet {} -> string
~proc greet|zig {
return "REGISTRY other";
}
// The registry copy of `koru/vaxis`. Reachable through the `koru` key alone —
// so if longest match were not applied, THIS is what the import would find.
~pub tor greet {} -> string
~proc greet|zig {
return "REGISTRY vaxis";
}
// The vendored copy. Reachable only through the longer `koru/vaxis` key.
~pub tor greet {} -> string
~proc greet|zig {
return "VENDORED vaxis";
}
Test Configuration
MUST_RUN