aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2016-09-09signal: Remove the signal command from child interpretersSteve Bennett1-17/+25
Currently signals can only be delivered to a single interpreter. To avoid confusion where currently this is the most recently created interpreter, don't create the signal command and handle signals in child interpreters. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-02tests: Fix return code when running tests without [interp]Steve Bennett1-2/+5
The return code was the wrong sense. Also, load 'interp' if possible. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-29lock.test: Improve check for aio.lock supportSteve Bennett1-3/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-29tests/exec.test: Add constraint "unix" for 12.1Danyil Bohdan1-2/+4
2016-08-28zlib: Fix arg error checkingSteve Bennett1-7/+7
It is wrong to call Jim_WrongNumArgs() with argc == 0. Instead -1 should be returned from the subcmd function to display the standard error message. Add a --maintainer check for this condition in Jim_WrongNumArgs() and fix the zlib unit tests. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-26If possible, run tests within a sub-interpreterSteve Bennett3-1/+58
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-20Fix aio locking on non-linux platformsSteve Bennett1-23/+12
And improve the tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-20add POSIX lock/unlock methods to aio objectsHummyPkg1-0/+60
2016-08-17expr: fixes for pow/**Steve Bennett1-0/+489
- integer version is much faster - handle -ve numbers - ** is right associative - add tests from Tcl 8.6 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-17expr: fix adjacent terms in function callsSteve Bennett2-14/+13
Previously two adjacent terms were incorrectly accepted, such as in pow(2 3) Correctly generate an error in this case and improve the error message when an expression fails to parse correctly. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-17expr: Improve mathfunc handlingSteve Bennett1-59/+63
Previously math functions with multiple arguments were handling poorly. For example: pow(1.0 + 3.0 - 2, .8 * 5) was evaluated as: pow(1.0 + 3.0, 2 - .8 * 5) Now commas correctly separate function parameters. Also, the error messages are more consistent and informative in the case of an invalid expression. Update and re-enable tests in tests/expr-old.test accordingly Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-17expr: add support for atan2, hypot and fmodSteve Bennett1-26/+33
And enable some more math tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-07-10Boolean contstants in expr, `string is boolean` classificationNikita Borodikhin3-3/+75
* named boolean values in `expr` are internally converted to int * named constants are lower-case only
2016-04-11tests/regexp: Remove regexp-22.1Steve Bennett1-32/+0
This test is unreliable since the OS may perform additonal caching. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-03-28zlib: Update zlib.test to use needs, testreportSteve Bennett1-27/+30
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-03-28zlib: add zlib bindingsDima Krasner1-0/+119
Including documentation and tests
2016-03-27Convert unnecessary usage of posix external utilities in tests to use native ↵Evan Hunter2-10/+9
tcl instead
2016-03-27exec: read output from pipe before waiting for childrenSteve Bennett1-7/+3
It is necessary to read output from the pipe before waiting for children to exit to avoid the output filling up and blocking. The error results still needs to be read after the children have exited, since it is read from a temp file, not a pipe. Increase the length of the input to test exec-8.1 to catch the problem. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-03-27lsort test: allow unstable lsort implementation to return results of same ↵Evan Hunter1-3/+8
value in different orders.
2016-02-02regexp: Enable additional regexp/regsub testsSteve Bennett2-88/+97
Many Tcl regexp tests now work correctly with Jim regexp Also update regsub/regexp wrong # args error message to match Tcl 8.6 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-02-02regexp: add support for \D, \W and \SSteve Bennett1-0/+3
These are the negated versions of \d, \w and \s Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-01-18Add the tcl_platform(engine) array element.mistachkin1-0/+3
2015-12-13regsub: fix substitution with a trailing backslashSteve Bennett1-0/+5
Should just replace with the bare backslash, not backslash '\0' Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-06-30build: Fix exit code on test failureSteve Bennett1-1/+1
Reported-by: Svyatoslav Mishyn <juef@openmailbox.org> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-04-06Avoid error in tcltest.tcl if $::argv0 is unsetSteve Bennett2-2/+2
Can happen if running interactively or via -e Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-04-06ensure that tests can find tcltest.tclSteve Bennett1-0/+4
Reported-By: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-12-31Throw an error when parsing a bad scriptSteve Bennett2-45/+53
If a script has a missing bracket (for example), currently it is silently ignored, except by [source] Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-12-04glob: fix some glob2.test tests on windowsSteve Bennett1-68/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-11-28glob: add additional testsSteve Bennett1-0/+344
Import some additional tests from the Tcl test suite. Add more Tcl compatibility to tcltest.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-11-28glob: bug fixes and Tcl compatibilitySteve Bennett1-3/+3
Fix the case where the pattern/filename contains a space Respect the —tails option, but generate an error if -types is given. Change the error message on no match to be Tcl-compatible Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-11-17Implement string cat (TIP #429)Steve Bennett1-2/+19
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-10-15Add more tcl compatiblitySteve Bennett1-1/+1
- Add wide() function to [expr] (same as int()) - Small error message changes Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-10-15Install tcltest compatibility packageSteve Bennett1-254/+6
Allow 3rd party tests to be written and use: package require tcltest Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-10-11jim.c: string to double conversion error messageSteve Bennett3-11/+11
Change the error message to match Tcl 8.6 "expected floating-point number" instead of "expected number" Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-10-10namespace: disallow creation of import loopsSteve Bennett1-1/+22
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-10-10namespace: restore namespace import supportSteve Bennett1-0/+15
Commit 8e28d066 "fixed" infinite namespace import recursion by simply disabling support for import. This commit restores support by detecting self-import. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-09-01aio: optional argument addrvar for accept.Danyil Bohdan1-1/+34
2014-07-26jim.c: make lindex work as identity function.Danyil Bohdan1-3/+7
2014-04-28event.test: Fix test on HaikuSteve Bennett1-2/+2
Haiku doesn't seem to trigger the "readable" event on a connected socket with no data, so use the "writable" event instead since this seems to work on all platforms. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-03-18jim.c: check for missing quotes, etc. in eval, exprSteve Bennett1-2/+2
Throw an error if a script or expression is missing a trailing bracket, brace or quote rather than simply ignoring the error. Reported-by: Florian Schäfer <florian.schaefer+github@gmail.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-18jim.c: fix some dict/list shimmering issuesSteve Bennett1-0/+11
Only do fast dict->list conversion if there is no string rep When converting list->dict, generate the string rep of a shared list to avoid loss of info when converting to dict. Also add a relevent test to dict.test Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15jim.c: simplify JimDictExpandArrayVariable()Steve Bennett1-9/+9
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15array: array set to non-dict should failSteve Bennett1-0/+4
Currently returns the error message but does not set JIM_ERR Also add a test case Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15namespace: disallow array element syntax for variablesSteve Bennett1-0/+6
Detect and generate an appropriate message if the variable name is an array element (dict sugar syntax) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15tests: Don't stop on the first errorSteve Bennett1-1/+1
But still return non-zero if there are any errors On some systems there are known test failures Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15tclcompat: it is finally time to remove [case]Steve Bennett1-86/+0
Use [switch] instead Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15tests: fix tests if tclcompat is not enabledSteve Bennett4-5/+27
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15pid: error message is now tcl 8.6 compatibleSteve Bennett1-2/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-03tailcall: properly merge tailcall framesSteve Bennett1-1/+43
Resolve the tailcall command immediately in [tailcall] and stash it. If a tailcall is currently being evaluated, new tailcalls in the same frame are merged/deferred to evaluate in the same C stack frame. Can't merge tailcall evaluations across uplevel. Add some tests for these cases Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-21Implement more dict sub commandsSteve Bennett1-0/+1249
dict for, values, incr, append, lappend, update, replace and info Also implement array stat (the same as dict info) Note that [dict info] and [array stat] are for useful for checking the behaviour of the hash randomiser Add Jim_EvalEnsemble() Signed-off-by: Steve Bennett <steveb@workware.net.au>