Index: tests/methods.test =================================================================== diff -u -r17b2bed824041ef05d7739b2151882d5f9ec1f88 -r8776580a91fa04fd52378dd37143f6c27769c8ab --- tests/methods.test (.../methods.test) (revision 17b2bed824041ef05d7739b2151882d5f9ec1f88) +++ tests/methods.test (.../methods.test) (revision 8776580a91fa04fd52378dd37143f6c27769c8ab) @@ -1084,37 +1084,39 @@ ? {e1 bar} bar } -nx::test case assertion-swallows-result { +nx::test case xotcl-assertion-swallows-result { - nx::Class create Edge { - :public method foo {} { - :configure -xxx 1 - } - :public method bar {} { - :configure -xxx 1 - } -postcondition {{1 == 0}} - :create e1 + package req XOTcl + + xotcl::Class create Edge + Edge instproc foo {} { + my set xxx } + Edge instproc bar {} { + my set xxx + } {} {{1 == 0}} + + Edge create e1 + # base case ? {catch {e1 foo} errMsg} 1 - ? {string match "invalid non-positional*" $errMsg} 1 + ? {string match {can't read "xxx":*} $errMsg} 1 ? {catch {e1 bar} errMsg} 1 - ? {string match "invalid non-positional*" $errMsg} 1 + ? {string match {can't read "xxx":*} $errMsg} 1 # turn on assertion checking nsf::method::assertion e1 check all # still report error when invariant would not return error ? {catch {e1 foo} errMsg} 1 - ? {string match "invalid non-positional*" $errMsg} 1 + ? {string match {can't read "xxx":*} $errMsg} 1 - # still report error when postcondition would not return error + # still report error when postcondition would return an error ? {catch {e1 bar} errMsg} 1 - ? {string match "invalid non-positional*" $errMsg} 1 - + ? {string match {can't read "xxx":*} $errMsg} 1 }