Browse Source

punk::ns 0.7.1: hygiene-pass backlog fixes - nslist -types default, nsjoinall error prefix (pins flipped)

Both fixes were pinned as known warts before the change; the pins flip with it:

- get_nslist: the -types default sat inside a braced dict-create literal, so it
  was the literal string $known_types - any call without -types (notably bare
  user-level `nslist`) errored with the malformed "Unrecognised namespace
  member type: $known_types". An unsupplied -types now defaults to all known
  member types. Pin flipped: nslist.test nslist_types_default_error_QUIRK ->
  nslist_types_default (bare nslist renders children + commands). nslist's own
  PUNKARGS -types gained help text, deliberately without a -default so the
  passthrough stays absent when unsupplied.
- nsjoinall: the non-empty-prefix-vs-absolute-path error message carried a
  copy-paste "nsjoin:" prefix - now "nsjoinall:". Pin flipped in
  nsprimitives.test nsjoinall_edges.
- nscommands: commented out a development trace puts (">>> base: ...") that
  polluted stdout on the weird-namespace path (same treatment as the 0.1.1
  doc-lookup trace-puts cleanup; not pinned).

Suites green: ns/nav/repl 111/111; full source-tree run at the known baseline
(only core exec-14.3, pre-existing). buildversion 0.7.0 -> 0.7.1; project
0.12.34 + CHANGELOG.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 11 hours ago
parent
commit
86883a496c
  1. 4
      CHANGELOG.md
  2. 2
      punkproject.toml
  3. 27
      src/modules/punk/ns-999999.0a1.0.tm
  4. 3
      src/modules/punk/ns-buildversion.txt
  5. 2
      src/tests/modules/AGENTS.md
  6. 18
      src/tests/modules/punk/ns/testsuites/ns/nslist.test
  7. 6
      src/tests/modules/punk/ns/testsuites/ns/nsprimitives.test

4
CHANGELOG.md

@ -5,6 +5,10 @@ The latest `## [X.Y.Z]` header must match the `version` field in `punkproject.to
Entries are newest-first; one bullet per notable change. See the root `AGENTS.md`
"Project Versioning" section for the bump policy.
## [0.12.34] - 2026-07-14
- punk::ns 0.7.0/0.7.1 comment/documentation hygiene pass + pinned-wart fixes: ~1200 lines of dead code removed (the fully commented-out arginfo predecessor of cmdhelp, the never-exported name-primitive twins nsparts1/nsprefix1/nsprefix_orig/nstail1/nstail_orig whose divergence was pinned before removal, obsolete nsglob_as_re1, empty stubs, misc commented remnants); stale docs corrected (nsprefix :::a comment, nsglob_as_re 'should be fixed' note, nstree_list empty PUNKARGS help, cmdhelp/corp help typos). Shell-visible fixes (0.7.1, pins flipped): bare `nslist` (no -types) now displays all member types instead of erroring with a malformed literal-$known_types message; nsjoinall's absolute-path error is now prefixed 'nsjoinall:' (was 'nsjoin:'); a development trace puts removed from nscommands' weird-namespace path. Flagged unchanged: get_nslist's apparently-unreachable alias display branches, superseded nscommands1/nscommands2 aliases, cmdtrace output noise (deferred to proposed G-085).
## [0.12.33] - 2026-07-14
- punk::repl 0.5.2: fixed the codethread seeding template creating a stray namespace named after the ::punk::nav::ns::ns_current variable in every code interp (a phantom 'ns_current' child visible when browsing the nav namespace with n/). Subshell namespace carry-over semantics unchanged. Plus n/ n// n/// display-and-navigation characterization groundwork for the planned punk-tables/width-responsive rework: new punk/ns nslist.test (classification buckets as machine contract, per-element marking pins, REWORK-flagged layout pins, bare -types quirk), new punk/nav/ns navns.test (navigation state machine + ns_current contract), new punk/repl nscurrent.test (real-codethread inscope evaluation, retention, navigation, auto-create, seeding-fix guard).

2
punkproject.toml

@ -1,4 +1,4 @@
[project]
name = "punkshell"
version = "0.12.33"
version = "0.12.34"
license = "BSD-2-Clause"

27
src/modules/punk/ns-999999.0a1.0.tm

@ -306,7 +306,9 @@ tcl::namespace::eval punk::ns {
foreach sub $args {
if {[string match ::* $sub]} {
if {[string length [concat {*}$segments]]} {
error "nsjoin: won't join non-empty namespace prefix to absolute namespace path '$sub'"
#2026-07-14 Agent-Updated: message previously said 'nsjoin:' (copy-paste wart,
#pin flipped in tests ns/nsprimitives.test nsjoinall_edges)
error "nsjoinall: won't join non-empty namespace prefix to absolute namespace path '$sub'"
}
}
lappend segments $sub
@ -1005,11 +1007,14 @@ tcl::namespace::eval punk::ns {
}
proc get_nslist {args} {
set known_types [list children commands exported imported aliases procs ensembles ooclasses ooobjects ooprivateobjects ooprivateclasses native coroutines interps zlibstreams]
set defaults [dict create {*}{
#2026-07-14 Agent-Updated: -types default was inside a braced literal, so it was the literal
#string '$known_types' - any call without -types (e.g bare nslist) errored with a malformed
#'Unrecognised namespace member type: $known_types' message. Fixed to default to all known
#types (pin flipped: tests ns/nslist.test nslist_types_default).
set defaults [dict create {*}{
-match ""
-types $known_types
-nsdict ""
}]
} -types $known_types]
set opts [dict merge $defaults $args]
# -- --- --- --- --- --- --- --- --- ---
set fq_glob [dict get $opts -match]
@ -1417,7 +1422,14 @@ tcl::namespace::eval punk::ns {
will display just a basic note: 'Also resolving cmds in namespace paths: <namespaces>'.
If -nspathcommands is true, it will also display subtables showing the commands resolvable
via any such listed namespaces."
-types
#2026-07-14 Agent-Updated: -types deliberately has no -default - an unsupplied -types must stay
#absent from the parsed opts so get_nslist's own all-types default applies.
-types -help\
"Restrict display to the given list of namespace member types
e.g {children commands procs aliases ensembles}
(the full set - plus the expanders 'oo' and 'all' - is validated by
punk::ns::get_nslist, which this option is passed through to).
When not supplied, all member types are displayed."
@values -min 0 -max -1
glob -multiple 1 -optional 1 -default "*"
}
@ -3765,7 +3777,10 @@ y" {return quirkykeyscript}
::continue
}
#info commands can't glob with weird_ns prefix
puts ">>> base: $base what: $what"
#2026-07-14 Agent-Updated: commented out a development trace puts that polluted
#nscommands stdout output on the weird-namespace path (same treatment as the 0.1.1
#doc-lookup trace-puts cleanup)
#puts ">>> base: $base what: $what"
::set all_ns_commands [nseval_ifexists $base [list apply {{loc what} {
set _all [uplevel 1 [list ::tcl::info::commands]]
set _matches [list]

3
src/modules/punk/ns-buildversion.txt

@ -1,6 +1,7 @@
0.7.0
0.7.1
#First line must be a semantic version number
#all other lines are ignored.
#0.7.1 - hygiene-pass backlog fixes (both pinned before the fix, pins flipped with it): (a) get_nslist's -types default was the literal string $known_types (braced-literal defaults bug) so any call without -types - notably bare user-level 'nslist' - errored with a malformed 'Unrecognised namespace member type: $known_types'; an unsupplied -types now defaults to all known member types (nslist.test nslist_types_default; nslist's own PUNKARGS -types gained help text and deliberately no -default so the passthrough stays absent when unsupplied). (b) nsjoinall's non-empty-prefix-vs-absolute-path error message carried a copy-paste 'nsjoin:' prefix - now 'nsjoinall:' (nsprimitives.test nsjoinall_edges). Also commented out a development trace puts ('>>> base: ...') that polluted nscommands stdout on the weird-namespace path (same treatment as the 0.1.1 trace-puts cleanup).
#0.7.0 - comment/doc hygiene pass (no change to shipped behaviour; minor bump for removed unused procs). Dead code removed (recoverable via git history): the fully commented-out predecessor help command 'arginfo' (~930 lines, replaced by cmdhelp), the superseded/deprecated name-primitive twins nsparts1/nsprefix1/nsprefix_orig/nstail1/nstail_orig (never exported, no callers; NOT drop-in equivalents - they collapse colon runs of 5+ differently, divergence pinned in tests ns/nsprimitives.test git history), obsolete nsglob_as_re1, empty stubs ns_relative_to_location/ns_absolute_to_location, obsolete internal::_pkguse_vars, an 'if 0' block in nstree_list, unused interp_aliases assignment in get_ns_dicts, and assorted commented-out code remnants. Stale docs corrected: nsprefix comment (:::a prefix is :: not ::a), nsglob_as_re 'should be fixed' note (fix has long been in place - * matches an inner single colon), cmdhelp typos, corp -syntax truncated help sentence, nstree_list empty PUNKARGS help fields filled. Flagged (comment only): get_nslist red-strike/masked alias display branches appear unreachable (see nslist.test fixture findings), nscommands1/nscommands2 pipeline aliases are superseded removal candidates (nscommands1 errors on use - references nonexistent nsthis2), cmdtrace stdout/stderr noise deferred to proposed G-085, test_switch* marked as live cmdtrace test fixtures. All inserted/updated comments carry 2026-07-14 Agent marks.
#0.6.0 - cmdtrace gains -pause <bool> (default 1 - existing interactive behaviour unchanged): -pause 0 bypasses the 'paused - hit enter key to continue' askuser in _cmdtrace_leave so cmdtrace can run non-interactively/scripted and the returned marked-up body report captured (gate: namespace variable _cmdtrace_pause). cmdtrace argdoc: the nested-switch traced-linenumber caveat now cites the upstream Tcl ticket (core.tcl-lang.org tktview 5d5b1052280c976ea3d4, reported by the developer) and records the characterized pattern (2026-07-14, punk-free minimal repro identical on 8.6.17/8.7a6/9.0.3): a nested single-block switch arm body reports lines shifted by (switch command's line within its containing script - 1) exactly when the arm's index into the split pattern/body list lands on a literal word of the switch command (options/--/block); dynamic-word or out-of-range indices report correctly arm-relative - so which arms mismark varies with the option words used, matching the ticket's observation. New testsuite ns/cmdtrace.test (pause flag, flat-switch and 2-word-nested correct-mark guards, upstream mismark GAP pins gated on have_tclcoredocs since cmdtrace's arm-offset correction needs the ::switch argdoc).
#0.5.0 - G-041 doc surface: cmdhelp's -form option defaults to * (was 0) and accepts the punk::args::parse list semantics - the usage display now presents the form the supplied argument words match: the advisory parse_status's matched/best-candidate form's argument table renders at both render sites (alias path and main), with every ranked candidate (noformmatch) or every matching form (multipleformmatches) passed to arg_error so all are marked in the synopsis block ('i after cancel <id>' presents the cancel form; 'i lseq 0 10 2' presents the range form). punk::ns::synopsis: with trailing argument words after a multiform command path (and no explicit -form), the form(s) the words match are underlined - matching forms from the advisory parse's formstatus, or the best candidate when no form fully matches ('s after cancel someid' marks both cancel forms; 's lseq 0 10 2' marks the range form); ordinal non-comment-line position maps lines to forms in declaration order for both the full and summary renders; skipped when alias currying makes the remaining words unreliable. cmdhelp.test gains the multiform doc-surface pins (autoselected form presented, noformmatch best-candidate table + candidate naming, synopsis marking present/absent).

2
src/tests/modules/AGENTS.md

@ -43,7 +43,7 @@ Unit tests for editable source modules under `src/modules/`, `src/modules_tcl8/`
- `punk/args/` — punk::args tests (`testsuites/args/`): parsing, choices/choicegroups, forms, rendering/indentation characterization, synopsis display characterization (`synopsis.test`: basic italic argname/`<type>` styling, longopt `--x=` alias forms, literal/literalprefix/stringstartswith/stringendswith type-alternates rendering unitalicised, option alternate parenthesization, multi-element clause display incl `?type?` members and argname tail-word hints, `-typesynopsis` value-element lists and option passthrough incl documenter ANSI, and the small-restricted-choice-set literal rule: 1-3 restricted choices render as unitalicised `|`-joined literals in leader/option/value positions with choicegroups counted, >3 or `-choicerestricted 0` falling back to italics, `-typesynopsis` taking precedence), usage-marking characterization (`usagemarking.test`: -parsedargs/-badarg/-parsestatus/-scheme marking primitives plus goodchoice highlighting of selected/default-in-effect choice words, asserted by SGR-parameter subset against the live colour arrays; the G-049 nocolour/colour-leak GAP pins flipped 2026-07-10 to scheme-statelessness assertions), the G-049 parse-status structure (`parsestatus.test`: punk::args::parse_status overall/per-argument statuses, badarg for type/allocation failures, -caller attribution, errorcode -argspecs stripping), -parsekey characterization (`parsekey.test`: result/received/solos/multis keying, shared-key required satisfaction and defaults, mash-path and prefix-abbreviation keying, plus GAP pins for last-defined-member default precedence, cross-member -multiple value loss, parsekey/optname collision conflation, and values/leaders parsekey breakage - desired-behaviour pins disabled behind punkargsKnownBug in `testsuites/dev/parsekey-knownbugs.test`), and tclcore doc/interpreter behavioural parity (`tclcoreparity.test`, G-054, gated on have_tclcoredocs: 'string is' class choices equal the live-harvested set, per-class docids exist, error-vs-ok agreement across the probe matrix, version-note labels conditional on class presence - expectations derived from the running interpreter, green on 8.6/8.7/9.0; under 8.6 run the file directly via a plain tclkit + tcltest driver since runtests' harness needs newer infrastructure)
- `punk/nav/ns/` — punk::nav::ns tests (`testsuites/nav/navns.test`): the n/ n// n/// navigation state machine (ns/ transitions absolute/relative/glob-no-nav, failed-nav state preservation, quad-colon normalization, v-form content selection, ensemble annotation) and the ::punk::nav::ns::ns_current variable contract the repl/codethread/subshell seeding all consume; display content is covered in punk/ns nslist.test
- `punk/repl/` — punk::repl tests (`testsuites/repl/`): opunk console backend integration (`consolebackends.test`) and repl current-namespace retention (`nscurrent.test`: real codethread via repl::init driven by synchronous runscript sends - inscope evaluation of ns_current, retention across submissions, n/-navigation retained, auto-create-with-notice for missing namespaces, the 2026-07-14 stray-namespace seeding fix pinned behaviourally plus a source-text guard on repl::start's inline template; the end-to-end piped subshell session is covered at shell level by shell/testsuites/punkexe/shellnavns.test - which found the first-subshell shared-code-interp asymmetry and the piped-inscope gap recorded there)
- `punk/ns/` — punk::ns tests (`testsuites/ns/`): cmdwhich/cmdinfo/cmd_traverse doc-lookup flow (`cmdflow.test`, G-040 parity), n/ display machinery characterization (`nslist.test`: tier A get_ns_dicts classification buckets as the machine contract for display reworks - incl package tail/prefix derivation, alias edge cases, usageinfo scan-dependence; tier B per-element layout-agnostic marking - underline/underdouble/underdotted namespace package styles, command type tag colours, exported/imported markers, the punkargs doc icon; tier C REWORK-flagged pins of the current hardcoded 2-col/4-col layout and nspath subtables, to flip deliberately with the planned punk-tables/width-responsive rework; plus the KNOWN QUIRK pin that bare nslist without -types errors with a malformed message), corp proc-retrieval and syntax/untabify interplay (`corp.test`: name edge cases, -ranges/-n line handling, basic-highlight ansistrip equivalence, -untabify spaces/unicode tab-free output, the KNOWN-DEFICIENCY pin for default -untabify none on tabbed bodies - grepstr warns per pass and brace overlays mangle tabbed lines, deterministic under mocked console tabstops - and a ::tcl::CopyDirectory -untabify spaces smoke test; precursor coverage for the planned punk::ns hygiene pass), cmdtrace characterization (`cmdtrace.test`: -pause 0 non-interactive runs, linedict line-mark keys for flat and 2-word-form nested switches as correct-mark guards, and GAP pins for the upstream nested-switch mismark - core.tcl-lang.org tktview 5d5b1052280c976ea3d4, arm bodies whose split-list index lands on a literal switch-command word report container-relative lines; mark tests gated on have_tclcoredocs because cmdtrace's arm-offset correction parses against the ::switch argdoc; plus the fixed-canary asserting punk::lib::check::has_tclbug_nestedswitch_tracelines still reports the bug - a live behavioural probe, so a fixed Tcl release fails the canary first and triggers the documented flip workflow), cmdhelp usage-rendering integration (`cmdhelp.test`: scheme selection, goodarg/badarg marking incl type/allocation failures, goodchoice highlighting of supplied/default choice words, alias path, cmdinfo result shape, queried-command failure attribution, and `-return dict` parse-status returns (G-049 - its GAP pins flipped 2026-07-10); remaining GAP pins for pseudo-command cmdtype + space-form docid prefixes (G-051, real `string is` pins behind the have_tclcoredocs constraint), TclOO undocumented-method fallback (G-052), and synopsis marking absence (G-050)), and name/path primitive characterization (`nsprimitives.test`: string pins for nsparts/nsprefix/nstail/nsjoin/nsjoinall incl weird colon-run (`:::`) splitting, the trailing-colon parse ambiguity (`::x:` + `y` joins to the same string as `::x` + `:y` and reparses leading-colon-greedy), and prefix/tail/join round-trip and its absolutizing exceptions (the original twin-divergence pins for nsparts1/nsprefix1/nsprefix_orig/nstail1/nstail_orig served as safe-deletion evidence and were removed with the twins in the punk::ns 0.7.0 hygiene pass - divergence record in this file's git history, commit 0c7168a1); plus nseval fq-requirement/create-on-eval/evaluator-proc caching, the native-vs-punk `p:::x` resolution divergence (native namespace eval reaches child `x`, nseval creates/reaches literal `:x`), nseval_ifexists no-create + error propagation on plain and genuinely weird namespaces, nsexists/nschildren/nstree_raw weird-ns and relative-resolution pins, globmatchns `*`/`**`/`?` semantics (incl `*` matching a single inner colon - a formerly stale 'should be fixed' comment above nsglob_as_re was corrected in the 0.7.0 hygiene pass), and nspath_to_absolute/nspath_here_absolute caller-resolution pins; known warts recorded in-test for the pass: nsjoinall error message prefixed 'nsjoin:')
- `punk/ns/` — punk::ns tests (`testsuites/ns/`): cmdwhich/cmdinfo/cmd_traverse doc-lookup flow (`cmdflow.test`, G-040 parity), n/ display machinery characterization (`nslist.test`: tier A get_ns_dicts classification buckets as the machine contract for display reworks - incl package tail/prefix derivation, alias edge cases, usageinfo scan-dependence; tier B per-element layout-agnostic marking - underline/underdouble/underdotted namespace package styles, command type tag colours, exported/imported markers, the punkargs doc icon; tier C REWORK-flagged pins of the current hardcoded 2-col/4-col layout and nspath subtables, to flip deliberately with the planned punk-tables/width-responsive rework; plus the flipped nslist_types_default pin - bare nslist without -types displays all member types since punk::ns 0.7.1 fixed the braced-literal -types default), corp proc-retrieval and syntax/untabify interplay (`corp.test`: name edge cases, -ranges/-n line handling, basic-highlight ansistrip equivalence, -untabify spaces/unicode tab-free output, the KNOWN-DEFICIENCY pin for default -untabify none on tabbed bodies - grepstr warns per pass and brace overlays mangle tabbed lines, deterministic under mocked console tabstops - and a ::tcl::CopyDirectory -untabify spaces smoke test; precursor coverage for the planned punk::ns hygiene pass), cmdtrace characterization (`cmdtrace.test`: -pause 0 non-interactive runs, linedict line-mark keys for flat and 2-word-form nested switches as correct-mark guards, and GAP pins for the upstream nested-switch mismark - core.tcl-lang.org tktview 5d5b1052280c976ea3d4, arm bodies whose split-list index lands on a literal switch-command word report container-relative lines; mark tests gated on have_tclcoredocs because cmdtrace's arm-offset correction parses against the ::switch argdoc; plus the fixed-canary asserting punk::lib::check::has_tclbug_nestedswitch_tracelines still reports the bug - a live behavioural probe, so a fixed Tcl release fails the canary first and triggers the documented flip workflow), cmdhelp usage-rendering integration (`cmdhelp.test`: scheme selection, goodarg/badarg marking incl type/allocation failures, goodchoice highlighting of supplied/default choice words, alias path, cmdinfo result shape, queried-command failure attribution, and `-return dict` parse-status returns (G-049 - its GAP pins flipped 2026-07-10); remaining GAP pins for pseudo-command cmdtype + space-form docid prefixes (G-051, real `string is` pins behind the have_tclcoredocs constraint), TclOO undocumented-method fallback (G-052), and synopsis marking absence (G-050)), and name/path primitive characterization (`nsprimitives.test`: string pins for nsparts/nsprefix/nstail/nsjoin/nsjoinall incl weird colon-run (`:::`) splitting, the trailing-colon parse ambiguity (`::x:` + `y` joins to the same string as `::x` + `:y` and reparses leading-colon-greedy), and prefix/tail/join round-trip and its absolutizing exceptions (the original twin-divergence pins for nsparts1/nsprefix1/nsprefix_orig/nstail1/nstail_orig served as safe-deletion evidence and were removed with the twins in the punk::ns 0.7.0 hygiene pass - divergence record in this file's git history, commit 0c7168a1); plus nseval fq-requirement/create-on-eval/evaluator-proc caching, the native-vs-punk `p:::x` resolution divergence (native namespace eval reaches child `x`, nseval creates/reaches literal `:x`), nseval_ifexists no-create + error propagation on plain and genuinely weird namespaces, nsexists/nschildren/nstree_raw weird-ns and relative-resolution pins, globmatchns `*`/`**`/`?` semantics (incl `*` matching a single inner colon - a formerly stale 'should be fixed' comment above nsglob_as_re was corrected in the 0.7.0 hygiene pass), and nspath_to_absolute/nspath_here_absolute caller-resolution pins; the nsjoinall error-message wart pin ('nsjoin:' prefix) flipped when punk::ns 0.7.1 fixed it)
- `punk/mix/` — punk::mix::cli tests (prune helpers, punkcheck virtual sources), punk::mix::commandset::repo fossil move/rename characterization tests (`testsuites/repo/`, FOSSIL_HOME-isolated; GAP-marked tests pin behaviour G-022 will change), punk::mix::commandset::loadedlib tests (`testsuites/loadedlib/libsearch.test`: 'dev lib.search' match semantics via -return list — wrap-glob default, =exact prefix, case rules, explicit globs, version aggregation — plus the loadedlib 0.2.0 contract: deep discovery by default (deep .tm modules found without -refresh, registration persists), -refresh = genuine re-scan (epoch incr + rediscovery picks up .tm files added to already-scanned dirs), and highlight working without the shell-global a+ alias; shared provisioned child interp sourcing the source-tree libunknown directly — see the file's ORDERING NOTE), and the MULTISHELL polyglot build machinery (`testsuites/scriptwrap/multishell.test`: scriptset wrap via the punk.multishell.cmd template - structure/LF-only/determinism, checkfile 512-byte label validation of fresh wraps AND the committed bin/runtime.cmd, the runtime scriptset round-trip byte-identity pin, and platform-gated execution smoke: cmd.exe→powershell payload on windows, sh payload on unix or via the `wsllinux` capability constraint from `src/tests/testsupport/wslprobe.tcl` - staged to the WSL distro's native filesystem, G-059)
- `punk/lib/` — punk::lib tests (`testsuites/lib/`): range/index/parse/compat/interp_sync utilities, G-058 static-baseline seeding (`staticseed.test`: interp_sync_package_paths/snapshot_package_paths propagate a simulated ::punkboot static baseline and seed `load {} <prefix>` ifneeded mappings; no-op without a baseline), and the repl command-completeness engine (`commandcomplete.test`: punk::lib::system::incomplete pending-opener stacks - the info-complete quoting quirk progression (`set x "{*}{"` standalone vs in-proc-body), single openers, tabs, escapes, incomplete<->info-complete parity property; pre-repl-refactor characterization, see goals/G-044 detail preserve-list)
- `punk/packagepreference/` — punk::packagepreference tests (`testsuites/packagepreference/`): G-058 static-vs-bundled policy (`staticpolicy.test`: require of a baseline package triggers the index scan before resolution so a newer bundled copy wins, static beats older bundled, exact requires of bundled versions stay reachable, missing static mappings get seeded)

18
src/tests/modules/punk/ns/testsuites/ns/nslist.test

@ -2,6 +2,7 @@ package require tcltest
package require punk::ns
package require punk::console
package require punk::ansi ;#ansistrip in nslist_types_default
#added 2026-07-14 (agent) - characterization of the n/ n// n/// display machinery
#(punk::ns::get_ns_dicts classification + get_nslist/nslist rendering), requested as
@ -323,18 +324,21 @@ namespace eval ::testspace {
1 1 1
]
test nslist_types_default_error_QUIRK {KNOWN QUIRK: nslist without -types raises with a malformed message (literal dollar-known_types)}\
#flipped 2026-07-14 (agent) from nslist_types_default_error_QUIRK: get_nslist's -types default was the
#literal string dollar-known_types (braced-literal defaults bug) so bare nslist errored; fixed in
#punk::ns 0.7.1 - an unsupplied -types now means all known member types.
test nslist_types_default {nslist without -types displays all member types (get_nslist all-types default)}\
-setup $fsetup -body {
#the shell pathway (punk::nav::ns::ns/) always passes -types, so this
#latent default is never hit interactively. Pinned for the hygiene pass:
#either give nslist a working -types default or a proper error message.
set err [catch {punk::ns::nslist ::navfix::*} msg]
set err [catch {punk::ns::nslist ::navfix::*} out]
lappend result $err
lappend result [string match {*Unrecognised namespace member type: $known_types*} $msg]
set plain [punk::ansi::ansistrip $out]
#a child namespace and a proc from the fixture both render (children + commands types active)
lappend result [string match *plainchild* $plain]
lappend result [string match *plainproc* $plain]
}\
-cleanup $fcleanup\
-result [list\
1 1
0 1 1
]
}
tcltest::cleanupTests ;#needed to produce test summary line.

6
src/tests/modules/punk/ns/testsuites/ns/nsprimitives.test

@ -143,7 +143,7 @@ namespace eval ::testspace {
1 1 1 1 1 1 1 1 1 1 :: ::a ::a
]
test nsjoinall_edges {nsjoinall - multiple segments, empty segments dropped, absolute arg allowed only while all preceding segments empty; error message says 'nsjoin:'}\
test nsjoinall_edges {nsjoinall - multiple segments, empty segments dropped, absolute arg allowed only while all preceding segments empty}\
-setup $common -body {
lappend result [punk::ns::nsjoinall ::]
lappend result [punk::ns::nsjoinall :: a b]
@ -154,13 +154,13 @@ namespace eval ::testspace {
lappend result [punk::ns::nsjoinall a] ;# single arg passes through
lappend result [punk::ns::nsjoinall {}]
lappend result [punk::ns::nsjoinall {} {} ::y] ;# absolute arg accepted - everything before it is empty
#note the error message prefix is 'nsjoin:' not 'nsjoinall:' (wart - candidate for the hygiene pass)
#flipped 2026-07-14 (agent): message previously carried a copy-paste 'nsjoin:' prefix - fixed in punk::ns 0.7.1
lappend result [catch {punk::ns::nsjoinall ::x ::y} emsg] $emsg
}\
-cleanup {
}\
-result [list\
:: ::a::b ::x::y::z a::b::c::d ::b ::x a {} ::y 1 {nsjoin: won't join non-empty namespace prefix to absolute namespace path '::y'}
:: ::a::b ::x::y::z a::b::c::d ::b ::x a {} ::y 1 {nsjoinall: won't join non-empty namespace prefix to absolute namespace path '::y'}
]
test nseval_creates_and_caches_evaluator {nseval requires a fully qualified ns, CREATES it if missing (documented WARNING), and caches a generated evaluator proc}\

Loading…
Cancel
Save