Index: tests/protected.test =================================================================== diff -u -rb8b81d5258a35f294599bb755a0cc15cf363972b -re3a84e351aaf79c02a63cc0741dde7b9bd550849 --- tests/protected.test (.../protected.test) (revision b8b81d5258a35f294599bb755a0cc15cf363972b) +++ tests/protected.test (.../protected.test) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) @@ -25,7 +25,7 @@ ? {c1 bar-SET} {1} ? {c1 bar-foo} {foo} -::nsf::methodproperty C SET call-protected true +::nsf::method::property C SET call-protected true ? {catch {c1 SET x 1} errorMsg; set errorMsg} {::c1: unable to dispatch method 'SET'} ? {::nsf::dispatch c1 SET x 2} {2} "dispatch of protected methods works" ? {c1 foo} {foo} @@ -35,7 +35,7 @@ ? {catch {c2 bar-SET} errorMsg; set errorMsg} {::c1: unable to dispatch method 'SET'} ? {c2 bar-foo} {foo} -::nsf::methodproperty C foo call-protected true +::nsf::method::property C foo call-protected true ? {catch {c1 SET x 1} errorMsg; set errorMsg} {::c1: unable to dispatch method 'SET'} ? {::nsf::dispatch c1 SET x 2} {2} "dispatch of protected methods works" ? {c1 bar} {bar} "other method work" @@ -46,12 +46,12 @@ ? {catch {c2 bar-foo} errorMsg; set errorMsg} {::c1: unable to dispatch method 'foo'} # unset protected -? {::nsf::methodproperty C SET call-protected} 1 - ::nsf::methodproperty C SET call-protected false -? {::nsf::methodproperty C SET call-protected} 0 -? {::nsf::methodproperty C foo call-protected} 1 - ::nsf::methodproperty C foo call-protected false -? {::nsf::methodproperty C foo call-protected} 0 +? {::nsf::method::property C SET call-protected} 1 + ::nsf::method::property C SET call-protected false +? {::nsf::method::property C SET call-protected} 0 +? {::nsf::method::property C foo call-protected} 1 + ::nsf::method::property C foo call-protected false +? {::nsf::method::property C foo call-protected} 0 ? {c1 SET x 3} 3 ? {::nsf::dispatch c1 SET x 2} {2} @@ -64,7 +64,7 @@ # define a protected method C protected method foo {} {return [current method]} -? {::nsf::methodproperty C SET call-protected} 0 +? {::nsf::method::property C SET call-protected} 0 ? {c1 SET x 3} 3 ? {::nsf::dispatch c1 SET x 4} {4} ? {catch {c1 foo} errorMsg; set errorMsg} {::c1: unable to dispatch method 'foo'} @@ -74,17 +74,17 @@ ? {c2 bar-SET} 1 ? {catch {c2 bar-foo} errorMsg; set errorMsg} {::c1: unable to dispatch method 'foo'} -? {::nsf::methodproperty C SET redefine-protected true} 1 +? {::nsf::method::property C SET redefine-protected true} 1 ? {catch {C method SET {a b c} {...}} errorMsg; set errorMsg} \ {Method 'SET' of ::C cannot be overwritten. Derive e.g. a sub-class!} -? {::nsf::methodproperty C foo redefine-protected true} 1 +? {::nsf::method::property C foo redefine-protected true} 1 ? {catch {C method foo {a b c} {...}} errorMsg; set errorMsg} \ {Method 'foo' of ::C cannot be overwritten. Derive e.g. a sub-class!} # check a predefined protection ? {catch {::nx::Class method dealloc {a b c} {...}} errorMsg; set errorMsg} \ {Method 'dealloc' of ::nx::Class cannot be overwritten. Derive e.g. a sub-class!} # try to redefined via alias -? {catch {::nsf::alias Class dealloc ::set} errorMsg; set errorMsg} \ +? {catch {::nsf::method::alias Class dealloc ::set} errorMsg; set errorMsg} \ {Method 'dealloc' of ::nx::Class cannot be overwritten. Derive e.g. a sub-class!} # try to redefine via forward ? {catch {C forward SET ::set} errorMsg; set errorMsg} \ @@ -96,7 +96,7 @@ # overwrite-protect object specific method Object create o o method foo {} {return 13} -::nsf::methodproperty o foo redefine-protected true +::nsf::method::property o foo redefine-protected true ? {catch {o method foo {} {return 14}} errorMsg; set errorMsg} \ {Method 'foo' of ::o cannot be overwritten. Derive e.g. a sub-class!}