Index: tests/forwardtest.xotcl =================================================================== diff -u -r73eb4eccd33d1a940e2d2ca6dccc2f74216f0576 -re5b7b9261b0de87bf7a45ff7416ecd967037fa0b --- tests/forwardtest.xotcl (.../forwardtest.xotcl) (revision 73eb4eccd33d1a940e2d2ca6dccc2f74216f0576) +++ tests/forwardtest.xotcl (.../forwardtest.xotcl) (revision e5b7b9261b0de87bf7a45ff7416ecd967037fa0b) @@ -5,6 +5,7 @@ ########################################### # trivial object delegation ########################################### +Test case delegation Object dog Object tail tail proc wag args { return $args } @@ -16,6 +17,7 @@ ########################################### # evaluating in scope ########################################### +Test case inscope Class X -parameter {{x 1}} X instforward Incr -objscope incr @@ -29,6 +31,7 @@ ########################################### # adding ########################################### +Test case adding Object obj obj forward addOne expr 1 + @@ -38,6 +41,7 @@ ########################################### # more arguments ########################################### +Test case multiple-args Object target target proc foo args {return $args} obj forward foo target %proc %self a1 a2 @@ -53,6 +57,7 @@ ########################################### # mixin example ########################################### +Test case mixin-via-forward Object create mixin mixin proc unknown {m args} {return [concat [self] $m $args]} @@ -71,6 +76,7 @@ ########################################### # sketching extensibe info ########################################### +Test case info-via-forward Object Info Info proc @mixin {o} { $o info mixin @@ -90,6 +96,7 @@ ########################################### # variations of placement of options ########################################### +Test case incr obj set x 1 obj forward i1 -objscope incr x @@ -99,6 +106,7 @@ ########################################### # introspeciton options ########################################### +Test case introspection Class C C instforward Info -methodprefix @ Info %1 %self @@ -126,6 +134,7 @@ ########################################### # test serializer ########################################### +Test case serializer package require xotcl::serializer obj proc test {} {puts "i am [self proc]"} set a [Serializer deepSerialize obj] @@ -136,6 +145,7 @@ ########################################### # test optional target cmd ########################################### +Test case optional-target obj set x 2 obj forward append -objscope ? {obj append x y z} 2yz @@ -147,14 +157,15 @@ ########################################### # arg including instvar ########################################### +Test case percent-cmd obj set x 10 obj forward x* expr {%my set x} * ? {obj x* 10} "100" ########################################### # positional arguments ########################################### - +Test case positioning-args obj forward @end-13 list {%@end 13} ? {obj @end-13 1 2 3 } [list 1 2 3 13] @@ -210,7 +221,7 @@ ############################################### # substitution depending on number of arguments ############################################### - +Test case num-args obj forward f %self [list %argclindex [list a b c]] obj proc a args {return [list [self proc] $args]} obj proc b args {return [list [self proc] $args]} @@ -223,6 +234,7 @@ ############################################### # option earlybinding ############################################### +Test case earlyinging obj forward s -earlybinding ::set %proc ? {obj s 100} 100 ? {obj s} 100 @@ -309,7 +321,7 @@ ########################################### # forward to expr + callstack ########################################### - +Test case callstack Object instforward expr -objscope Class C