Jim Tcl
Timeline
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

50 most recent check-ins that include changes to files matching 'tests/*'

2023-02-25
00:00
build: appveyor: support different libssl version

Use wildcards when packaging libssl in case the version changes.

Signed-off-by: Steve Bennett <steveb@workware.net.au> Leaf check-in: 5257f2d41e user: steveb@workware.net.au tags: trunk

2023-02-24
03:02
dict with: return script result

Previously dict with returned the new dict value. Also fix an issue in the case where a dict element mirrors the name of the dictionary.

Fixes: #241

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 7ace58bcdc user: steveb@workware.net.au tags: trunk,

2023-02-13
00:52
ensemble: Add a simple ensemble command

Uses a prefix to automatically map from subcommand to implementation.

Includes support for namespace ensemble

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 5a037b62db user: steveb@workware.net.au tags: trunk,

00:44
vwait: add support for vwait -signal

To break vwait if a handled signal is received. In this case, the handled signal(s) can be returned by signal check ?-clear?

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 3d0ae7ddcd user: steveb@workware.net.au tags: trunk,

00:42
Tcl-compatible 'info frame'

Returns a dictionary with file, line, cmd, (possibly) proc and level. And support 'info frame 0' for the current command.

Note that now all evaluation frames are captured, not just call frames.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 056f7c6929 user: steveb@workware.net.au tags: trunk,

2023-02-06
00:59
tests: exec2: may need to set default SIGPIPE disposition

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 23c260ed7b user: steveb@workware.net.au tags: trunk,

00:59
tests: Don't run exec2 in a child interpreter

Since signals aren't supported there and we need signals for some of these tests.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 3efcafb4ae user: steveb@workware.net.au tags: trunk,

2022-12-25
23:23
tests: add garbage collection tests

These tests provoke the issues raised in #245 plus some additional issues.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: bc577f7c7a user: steveb@workware.net.au tags: trunk,

2022-12-03
01:18
regexp: fix end of word check

The end of word check was wrong and return true when it should not.

Fixes #246

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 6d2b3e5332 user: steveb@workware.net.au tags: trunk,

2022-08-29
00:44
tests: lock.test: child lock test should be more reliable

Some systems need a little extra time for the child process to start and acquire the lock.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: e4e9275d86 user: steveb@workware.net.au tags: trunk,

2022-08-21
07:17
tree: node ids are now simple integers

Dictionary lookups with simple integers are more efficient than with "node<integer>"

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: d281670753 user: steveb@workware.net.au tags: trunk,

04:14
tests: Fix file.test on Windows

file executable doesn't do anything useful on Windows

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 2bc96398b8 user: steveb@workware.net.au tags: trunk,

00:27
tests: file.test - increase code coverage

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 6f825019de user: steveb@workware.net.au tags: trunk,

2022-07-31
08:17
tests: Fix SIGPIPE tests

These tests were only working accidentally (typo >$@w). In fact since open |... already provides a pipe on output there is no need to create one manually, so the first test can run under Tcl too.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: d32941c9d8 user: steveb@workware.net.au tags: trunk,

2022-07-25
12:45
unset: don't return a result with -nocomplain

unset -nocomplain abc(missing)

was still returning an error message, but as a normal return. It should return an empty result.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 19c71d5d77 user: steveb@workware.net.au tags: trunk,

2022-05-08
05:45
tests: add tests for wait -1

Only on unix systems, wait for any child process This was broken with a recent commit, so add an explicit test

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 5cfa0b8b3a user: steveb@workware.net.au tags: trunk,

2022-04-14
01:18
aio: TIP 603 - Implement stat of an open file handle

Although the interface is different ('$handle stat' vs 'chan configure -stat') the behaviour is the same.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 61f2b6afcb user: steveb@workware.net.au tags: trunk,

01:13
win32: Fix process handle vs pid distinction

On win32, a process is identified by a HANDLE, but for identifying a running process we should use GetProcessId() to return a meaningful integer.

This means we need to be able to back and forth between a pid and a process handle (phandle). We also need to be careful to get the pid before the process handle closes since it isn't available afterwards.

Also call the handle to intptr_t for open_osfhandle() to avoid a compiler warning.

Fixes #217

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 1f03b61432 user: steveb@workware.net.au tags: trunk,

2022-04-13
21:51
try: add support for trap

In addition to "on codes ..." it is now possible to trap on errorcode with "trap sublist ..."

e.g.

try { ... } trap CHILDSTATUS {msg opts} { ... }

Fixes #204

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 440ee3405c user: steveb@workware.net.au tags: trunk,

2022-04-11
21:34
getref, setref: No need to allow for leading, trailing space

There is no reason to allow a reference to contain leading and/or trailing white space, so remove this check and simply treat it as an invalid reference.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 6f5b0e279c user: steveb@workware.net.au tags: trunk,

2022-04-10
23:36
getref, setref: reference may be qualified

oo.tcl returns globally qualified names like ::<reference.<tree___>.00000000000000000000>

So allow getref and setref to handle these qualified references

Fixes #218

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: dbe99d114e user: steveb@workware.net.au tags: trunk,

2022-02-23
02:26
tests: Fix load.test when jimsh not yet installed

Needs include, lib paths when jim is not installed

Fixes: #216

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: d3f8f66351 user: steveb@workware.net.au tags: trunk,

2021-12-13
11:04
dict: Fix possible duplicate entries when setting

Due to the way hash collisions are managed it is possible to have a sequence where an entry is removed and then another entry is replaced, however the replacement adds an additional entry instead of updating the existing entry.

Can be reproduced like this as there is a hash collision between these two keys:

dict set d 0,13 X dict set d 8,4 Y dict unset d 0,13 dict set d 8,4 Z

Should result in one entry in the dictionary, but instead ends with two.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 4ba9ecbebf user: steveb@workware.net.au tags: trunk,

2021-11-28
00:39
build: update appveyor version number

Signed-off-by: Steve Bennett <steveb@workware.net.au> Leaf check-in: 4e470a5e50 user: steveb@workware.net.au tags: trunk

2021-07-08
22:32
tests: move garabage collection test to ref.test

bootstrap jimsh doesn't have garbage collection, so move such tests into ref.test

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 5f8d965e92 user: steveb@workware.net.au tags: trunk,

12:36
collect: correctly handle references as globally scoped names

When a reference is used as a command name (e.g. in oo.tcl) it is created in the global namespace as ::<reference...

The current check for references that are commands with a reference count of 1 doesn't take this into account so these references were not being garbage collected.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: cfa6aa94e4 user: steveb@workware.net.au tags: trunk,

2021-04-08
22:29
build: Allow some paths to contain spaces

Quote the build dir or and the path to jimsh/tclsh in the Makefile in case they contain spaces.

Also fix a few problems in tests/ that arise when the build and/or source dir contain spaces.

Fixes #199

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 9940807fd4 user: steveb@workware.net.au tags: trunk,

2021-03-09
22:53
tests: Fix debug.test for single arg expr

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: a6cf5584e3 user: steveb@workware.net.au tags: trunk,

12:08
expr: TIP 526, only support a single arg

Avoid unexpected issues by concatenating multiple arguments. This does create an incompatibility with early versions, but it is generally trivial to convert existing code to one of two forms:

1. expr {$a + $b} -- usually correct 2. expr "$a + $b" -- usually incorrect

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: d2275407f6 user: steveb@workware.net.au tags: trunk,

2021-02-26
22:49
aio: tests: bootstrap jimsh doesn't have posix open flags

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: fd542496b9 user: steveb@workware.net.au tags: trunk,

22:48
tests: Fix return code from tests/runall.tcl

In the case where interp is not supported

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 32de3899c0 user: steveb@workware.net.au tags: trunk,

20:17
aio: open: support for POSIX open flags

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 628572b9ee user: steveb@workware.net.au tags: trunk,

2021-01-30
00:00
lsearch, lsort: support for -stride and -index

Add -stride support to both lsearch and lsort Add -index support to lsearch Improve -index for lsort to support multiple indices

Also harmonise some error messages with Tcl 8.7

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: f3223d0a64 user: steveb@workware.net.au tags: trunk,

2021-01-23
02:49
history: Add support for history keep

Fixes #191

Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: D. Bohdan <dbohdan@dbohdan.com> check-in: 1f877e4da6 user: steveb@workware.net.au tags: trunk,

2021-01-09
01:06
Add the [xtrace] command

Allows a debugger or tracing facility to be implemented

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 240f6048c1 user: steveb@workware.net.au tags: trunk,

2021-01-06
03:07
configure: Add --allextmod option

To build all non-default extensions as modules if prerequisites are met.

Also move the extension help out of the main help since it is quite long and show it with --extinfo. Now extension help is generated from $extdb to avoid the help and the module configuration becoming out of sync.

Signed-off-by: Steve Bennett <steveb@workware.net.au> Leaf check-in: 22ff3326d5 user: steveb@workware.net.au tags: trunk

2021-01-03
03:09
bootstrap jimsh: pass all tests

In order to test bootstrap jimsh, it is very helpful if it can pass all the unit tests.

- Set tcl_platform(bootstrap) to 1 for bootstrap jimsh or 0 otherwise - Use getref to determine in we have references, not ref since we implement a poor-man's ref for bootstrap jimsh - bootstrap jimsh package doesn't return a "Can't load package" message if loading the package fails - exec tests using [open |command] need pipe - bootstrap jimsh can't set file times with [file mtime]

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: fede70dd50 user: steveb@workware.net.au tags: trunk,

2021-01-02
14:52
core: fix parsing of booleans

When boolean parsing was combined in commit 982ec4f524bc81a240cb729cf09bd3c677aea485 it broken parsing of boolean values in expressions that weren't standalone.

e.g. expr {true} was fine, but expr {true ? 4 : 5} was not.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 2ad0450cbd user: steveb@workware.net.au tags: trunk,

2020-12-26
08:08
loop: Allow start value to be omitted

It is convenient to be able to do just:

loop i 5 { body }

Where the start value is 0.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 745409de58 user: steveb@workware.net.au tags: trunk,

08:08
core: commands that take an index now use integer expressions

This means that instead of just [list index 2+1], we can now do [list index end-$n*2+1]

This applies to:

lindex, linsert, lreplace, lset, lrange, lsort, regexp, regsub string index,first,last,range

Also add tests for both direct integer expressions and indexes.

Still needs doc update.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: af9deaf9fb user: steveb@workware.net.au tags: trunk,

08:08
core: support integer expressions in various commands

For convenience, many commands now accept integer expressions rather than only simple integers.

These are:

loop, range, incr, string repeat, lrepeat, pack, unpack, rand

This simplifies many cases where previously expr {} or $() was required. e.g.

foreach i [range 4+1 2*$b] { ... } string repeat 2**$n a

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 2847cd4406 user: steveb@workware.net.au tags: trunk,

2020-12-11
12:00
list, string: support any number of +/-n for index

It is especially convenient to add -1 for something like:

lindex $list end-$BACK-1

or:

string range $str $p $p+$len-1

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 61ede53228 user: steveb@workware.net.au tags: trunk,

2020-11-16
12:09
expr: TIP 582 - comments in expressions

Add support for comments in expressions

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 76644b5416 user: steveb@workware.net.au tags: trunk,

2020-11-13
22:57
core: parser: fix for script with missing end quote

Ensure that 'info complete' returns 0 for a script is missing the end quote such as "abc$def

Fixes #181

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 496c71fb96 user: steveb@workware.net.au tags: trunk,

22:33
tests: ssl: use flush, not close

Using 'close w' with an ssl socket doesn't really work because this is done only on the underlying socket.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 5cd252c848 user: steveb@workware.net.au tags: trunk,

22:28
tests: aio tty: skip tests if stdout is not a tty

Fixes: #182

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 27ebac8d9f user: steveb@workware.net.au tags: trunk,

2020-11-09
06:38
aio: socket: Fix tests connecting to 0.0.0.0

It is not portable to connect to 0.0.0.0, expecting this to the same as connecting to localhost/127.0.0.1, and the same for IPv6. So explicitly connect to 127.0.0.1 or [::1]

Fixes #180

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 8a3f09cc1b user: steveb@workware.net.au tags: trunk,

2020-11-08
00:17
build: Fix build and tests for out-of-tree build

Loadable modules and tests Fixes #179

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: bf32293584 user: steveb@workware.net.au tags: trunk,

2020-10-31
22:46
scan.test: Be more lenient in floating point format

Some systems produce 5e-05 while some produce 5e-5. Both are acceptable.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 097b6bd13e user: steveb@workware.net.au tags: trunk,

22:46
build: Fix the appveyor build

Signed-off-by: Steve Bennett <steveb@workware.net.au> Leaf check-in: b4017a73cb user: steveb@workware.net.au tags: trunk