tcl: fix Phase 7d oo tests using ::name-with-hyphens
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 51s
Tcl tokenizer treats $::g-name as $::g + literal -name, so the var lookup fails. Renamed test vars to ::gname / ::nval (no hyphens). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -652,7 +652,7 @@
|
||||
(ok "oo-constructor"
|
||||
(get
|
||||
(run
|
||||
"oo::class create G {\nconstructor {n} { set ::g-name $n }\nmethod hello {} { return [string cat \"hi \" $::g-name] }\n}\nset g [G new World]\n$g hello")
|
||||
"oo::class create G {\nconstructor {n} { set ::gname $n }\nmethod hello {} { return [string cat \"hi \" $::gname] }\n}\nset g [G new World]\n$g hello")
|
||||
:result)
|
||||
"hi World")
|
||||
|
||||
@@ -673,7 +673,7 @@
|
||||
(ok "oo-multiple-instances"
|
||||
(get
|
||||
(run
|
||||
"oo::class create N {\nconstructor {x} { set ::n-val $x }\nmethod get {} { return $::n-val }\n}\nset a [N new 1]\nset b [N new 99]\n$b get")
|
||||
"oo::class create N {\nconstructor {x} { set ::nval $x }\nmethod get {} { return $::nval }\n}\nset a [N new 1]\nset b [N new 99]\n$b get")
|
||||
:result)
|
||||
"99")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user