diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | jim.c | 6 | ||||
-rw-r--r-- | test.tcl | 36 |
3 files changed, 28 insertions, 19 deletions
@@ -1,3 +1,8 @@ +2005-03-19 20:12 antirez + + * ChangeLog, Makefile, TODO, jim.c, jim.h: [finalize] command and + relative C API added (SS). + 2005-03-18 12:39 antirez * ChangeLog, jim.c: now [setref] returns the value assigned to the @@ -1,7 +1,7 @@ /* Jim - A small embeddable Tcl interpreter * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * - * $Id: jim.c,v 1.121 2005/03/19 19:12:30 antirez Exp $ + * $Id: jim.c,v 1.122 2005/03/19 21:39:34 antirez Exp $ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -5563,7 +5563,7 @@ int Jim_GetIndex(Jim_Interp *interp, Jim_Obj *objPtr, int *indexPtr) if (objPtr->typePtr == &intObjType) { jim_wide val = objPtr->internalRep.wideValue; if (!(val < LONG_MIN) && !(val > LONG_MAX)) { - *indexPtr = (val < 0) ? INT_MAX : (long)val;; + *indexPtr = (val < 0) ? -INT_MAX : (long)val;; return JIM_OK; } } @@ -10206,7 +10206,7 @@ int Jim_InteractivePrompt(Jim_Interp *interp) printf("Welcome to Jim version %d.%d, " "Copyright (c) 2005 Salvatore Sanfilippo\n", JIM_VERSION / 100, JIM_VERSION % 100); - printf("CVS ID: $Id: jim.c,v 1.121 2005/03/19 19:12:30 antirez Exp $\n"); + printf("CVS ID: $Id: jim.c,v 1.122 2005/03/19 21:39:34 antirez Exp $\n"); Jim_SetVariableStrWithStr(interp, "jim_interactive", "1"); while (1) { char buf[1024]; @@ -1,4 +1,4 @@ -# $Id: test.tcl,v 1.22 2005/03/15 14:05:38 antirez Exp $ +# $Id: test.tcl,v 1.23 2005/03/19 21:39:34 antirez Exp $ # # This are Tcl tests imported into Jim. Tests that will probably not be passed # in the long term are usually removed (for example all the tests about @@ -29,21 +29,6 @@ proc test {id descr script expectedResult} { proc error {msg} { return -code error $msg } ################################################################################ -# JIM REGRESSION TESTS -################################################################################ -test regression-1.0 {Rename against procedures with static vars} { - proc foobar {x} {{y 10}} { - incr y $x - } - foobar 30 - foobar 20 - rename foobar barfoo - list [barfoo 1] [barfoo 2] [barfoo 3] -} {61 63 66} - -rename barfoo {} - -################################################################################ # SET ################################################################################ @@ -3459,6 +3444,25 @@ test lrange-2.4 {error conditions} { #} {1 {unmatched open brace in list}} ################################################################################ +# JIM REGRESSION TESTS +################################################################################ +test regression-1.0 {Rename against procedures with static vars} { + proc foobar {x} {{y 10}} { + incr y $x + } + foobar 30 + foobar 20 + rename foobar barfoo + list [barfoo 1] [barfoo 2] [barfoo 3] +} {61 63 66} + +rename barfoo {} + +test regression-1.1 {lrange bug with negative indexes of type int} { + lrange {a b c} 0 [- 0 1] +} {} + +################################################################################ # FINAL REPORT ################################################################################ |