aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2010-12-14Platform differences for regexp messagesSteve Bennett1-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-14Fix constraint checkingSteve Bennett3-6/+10
This was completely wrong. The arg order was wrong such that when test constraints were specifed the test was always skipped! Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-14Include all double colons as part of the var nameSteve Bennett1-0/+7
e.g. $::a::b is considered as ${::a::b} This helps be more Tcl compatible by allowing fake namespace variables Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-06Add more dependencies for testsSteve Bennett13-9/+32
Allow tests to run with almost all features disabled
2010-12-02Add the [exists] commandSteve Bennett1-0/+78
Especially simplifies checking for the existence of procs. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-28Bug fix: regexp should not treat \n as |Steve Bennett1-0/+4
Remove a "feature" in the built-in regexp, where a newline in the pattern was treated as alternation, like |. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-24Add support for [dict] size, merge, withSteve Bennett1-0/+158
Implement 'dict with' and 'dict merge' as scripts since this is simpler. Use 'dict size' to implement 'array size' Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-24Remove the bio extension and add 'copyto' to aio.Steve Bennett1-1/+2
The bio extension is a hangover from TinyTcl. Since Jim supports binary strings, there isn't much need for it except for 'bio copy'. So move this to aio as 'copyto' and implement 'file copy' in terms of it. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-22Overhaul unit test frameworkSteve Bennett50-345/+391
Much closer to tcltest now, including constraints. Try to get all appropriate tests running under both Jim and Tcl. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-19Better Tcl compatibility for [lrepeat]Steve Bennett1-6/+4
With zero count and also with no list elements Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Bug fix: [regexp] single braced count was rejectedSteve Bennett1-0/+4
The form {n} should be considered the same as {n,n} Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Bug fix: [split] string with leading nullSteve Bennett1-0/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Add UTF-8 support to regexpSteve Bennett5-207/+1236
Plus various ARE enhancements and bug fixes Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Add UTF-8 support to JimSteve Bennett9-28/+1121
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-08Don't hardcode /lib/jimSteve Bennett1-1/+2
Instead, set TCL_LIBRARY based on where jim is installed. This defaults to /usr/local (thus /usr/local/lib/jim), or can be modified with either configure or make. e.g. ./configure --prefix=/usr or make prefix=/usr install Now auto_path is initialised only to TCL_LIBRARY, and doesn't include "." which could be undesirable. At the same time, simplify jimsh initialisation using a script instead of C code. Add the path to the executable to auto_path. Also, no longer use JIM_TCL_COMPAT. Always use the tcl-compatible names, $auto_path and $tcl_interactive. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-03Fix 'make test' from the jimtcl directorySteve Bennett1-3/+3
Clash with JIMSH definition Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: Kulcsár Ferenc <crusader@netbsd.hu
2010-10-30Allow extensions to be built/installed as modulesSteve Bennett1-0/+1
This includes C extensions and Tcl extensions Also adds windows support (mingw32 and cygwin) Now the sqlite*, readline and win32 extensions are supported Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-20Switch regexp/regsub to use Jim_GetEnum()Steve Bennett1-8/+6
Provides a better error message on wrong args and allows abbreviations. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-20Fix some outlier issues with regexp/regsubSteve Bennett2-582/+642
Use number of paren expressions with regexp -inline Fix a problem with regexp -start and an anchored search Fix regexp -inline -indices Fix regexp matching with an empty pattern (e.g. ^) Fix some cases where regsub -all did not return all results Fix some regsub cases with an empty pattern Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-20Add support for lsort -indexSteve Bennett1-0/+193
Also bring in some lsort tests from Tcl Also allow lsort to be reentrant (but not thread safe) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix regsub to support strings with embedded nullsSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix a concat bugSteve Bennett1-0/+32
If a string ended in backslash-space, the trailing space was lost. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix error message for deleting nonexistent procSteve Bennett1-0/+155
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix some problems with global and upvarSteve Bennett1-0/+323
Redefining a link with upvar or global gave an error. Trying to access a non-existent var via a link gave the wrong error message. Added Tcl upvar tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Portability fixesSteve Bennett1-2/+4
Especially for eCos, mingw32 and cygwin Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement 'pid handle'Steve Bennett1-0/+48
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Skip tests for features which are not availableSteve Bennett13-11/+32
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Source location for failed tests was wrongSteve Bennett1-1/+15
That is, tests which didn't fail but did not give the expected result Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Change tree API to be object-basedSteve Bennett1-43/+43
A small change, but makes for a more natural interface Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Use $::env to build environment for execSteve Bennett1-0/+39
Also, switch to using 'sh -c' for the vfork() implementation because it then allows command line redirection, pipes and setting the environment. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add do-nothing fileevent for Tcl compatibilitySteve Bennett1-5/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Don't depend on specific regexp messagesSteve Bennett1-6/+6
These can vary on different systems Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Move test.tcl to tests/jim.testSteve Bennett3-25/+4372
And other small testing improvements Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15eventloop improvements and enhancementsSteve Bennett3-47/+540
Move Jim_EvalObjBackground() out of the core to eventloop Time events are now kept and triggered in time order Time handlers are removed before execution Add 'update' Add 'after info' and 'after idle' Include time events in the return from Jim_ProcessEvents() Add Tcl eventloop tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix some eventloop bugsSteve Bennett1-0/+150
bgerror is supposed to be suppressed subsequently if it returns break vwait should error on invalid array element vwait should return an empty result Don't accept 'after info' since it isn't supported Also add some eventloop tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Source info was lost when converting source to listSteve Bennett1-16/+17
This meant that the single arg switch case would not give accurate line numbers Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add 'string is' to JimSteve Bennett1-0/+163
Also, double parsing now allows trailing white space Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett3-138/+39
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Small improvements to testsSteve Bennett5-24/+35
Make exec-9.7 test more reliable Quieten jim tests unless running manually Add jim pipe example Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to tailcallSteve Bennett2-6/+57
Add tests and documentation Make tailcall work within 'try' Fix tailcall interaction with uplevel Use tailcall for dispatch in tree.tcl Also some related improvements in tree.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Move some core procs into the (Tcl) stdlib extensionSteve Bennett3-1/+144
Also implement 'local' to declare/delete local procs * Add tests/alias.test for testing alias, current, local * proc now returns the name of the proc created * Add helper 'function' to stdlib Reimplement glob and case to use local procs * This keeps these internal procs out of the global namespace Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to 'file mkdir', 'file delete'Steve Bennett1-0/+65
file mkdir will now create intermediate directories file delete can now also delete empty directories Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to catch, return, signal, trySteve Bennett5-60/+148
Improve the ability to rethrow errors * Allow return to rethrow an error by accepting '-errorinfo stacktrace' * Also, 'catch ... opts' now also stores opts(-errorinfo) on error * Use these to provide better stack traces from 'case' and 'try' * Implement 'return -level' Make try/on/finally more Tcl 8.6 compatible * With support for 'on' handlers and docs Add support for catch options to try * Otherwise it's hard to use try to catch signals Improvements to signal handling * catch -signal now sets a list of the handled signals as the result * catch -signal won't execute the body at all if a handled signal is pending * up to 64 (jim_wide) signals can now be handled * if catch -signal is nested, the innermost catch will catch the error * new 'signal catch' allows ignored/blocked signals to be examined and cleared. * update docs on signal handling exec should indicate which signal killed the child Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix lassign to work properly with an empty listSteve Bennett1-0/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix 'format %%'Steve Bennett1-0/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add tests for 'file copy'Steve Bennett1-0/+62
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Enhance catch and 'info returncodes'Steve Bennett1-6/+9
*: Add optional arg to catch, opts, like Tcl 8.5 to allow access to the code given by 'return -code' *: Use -- to signify end of options to catch *: 'info returncodes' can give the name of a single code *: Fix 'case' to handle 'return -code' properly
2010-10-15Add basic Tcl implementation of 'try ... finally'Steve Bennett1-0/+65
2010-10-15Improve stack trace handlingSteve Bennett4-23/+146
*: Get rid of JIM_ERR_ADDSTACK and use interp->addStackTrace instead *: 'return -code error' doesn't add a stack frame *: Rename _file_copy to {file copy} for better error messages *: Use 'return -code' to prevent excessive levels in the stack trace Also rename info_nameofexecutable to {info nameofexecutable}
2010-10-15Add exec support for 2>@1Steve Bennett1-0/+4
See TIP #202: http://www.tcl.tk/cgi-bin/tct/tip/202.html