From 978b1c10b76aed1e7c18d325b3f25cfa9a4fcb0d Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 8 Oct 2004 22:44:49 +0000 Subject: Fix things so we can pass our own test suite for TIP#212... --- generic/tclDictObj.c | 6 +++--- tests/dict.test | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 9fadc83..5863cd2 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclDictObj.c,v 1.22 2004/10/08 15:05:05 dkf Exp $ + * RCS: @(#) $Id: tclDictObj.c,v 1.23 2004/10/08 22:44:49 dkf Exp $ */ #include "tclInt.h" @@ -2787,7 +2787,7 @@ DictUpdateCmd(interp, objc, objv) dictPtr = Tcl_ObjGetVar2(interp, objv[2], NULL, 0); if (dictPtr == NULL) { - return TCL_OK; + return result; } /* @@ -2825,7 +2825,7 @@ DictUpdateCmd(interp, objc, objv) */ if (Tcl_ObjSetVar2(interp, objv[2], NULL, dictPtr, - TCL_LEAVE_ERR_MSG) != TCL_OK) { + TCL_LEAVE_ERR_MSG) == NULL) { Tcl_DiscardResult(&sr); if (allocdict) { TclDecrRefCount(dictPtr); diff --git a/tests/dict.test b/tests/dict.test index b8ad05d..c1004eb 100644 --- a/tests/dict.test +++ b/tests/dict.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: dict.test,v 1.10 2004/10/08 21:10:36 dkf Exp $ +# RCS: @(#) $Id: dict.test,v 1.11 2004/10/08 22:44:49 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -959,14 +959,14 @@ test dict-21.11 {dict update command} { dict update a b v1 d v2 { dict set a f g } - getOrder a b d f + getOrder $a b d f } {b c d e f g 3} test dict-21.12 {dict update command} { set a {b c d e} dict update a b v1 d v2 f v3 { set v3 g } - getOrder a b d f + getOrder $a b d f } {b c d e f g 3} test dict-22.1 {dict with command} -body { @@ -976,12 +976,12 @@ test dict-22.2 {dict with command} -body { dict with v } -returnCodes 1 -result {wrong # args: should be "dict with dictVar ?key ...? script"} test dict-22.3 {dict with command} -body { - catch {unset v} + unset -nocomplain v dict with v {error "in body"} } -returnCodes 1 -result {can't read "v": no such variable} test dict-22.4 {dict with command} { set a {b c d e} - catch {unset b d} + unset -nocomplain b d set result [list [info exist b] [info exist d]] dict with a { lappend result [info exist b] [info exist d] $b $d @@ -1009,7 +1009,7 @@ test dict-22.7 {dict with command} { dict with a { dict unset a b } - getOrder a b d + getOrder $a b d } {b c d e 2} test dict-22.8 {dict with command} { set a [dict create b c] -- cgit v0.12