aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2020-03-05build: Check for 32-bit time_t at configure timeSteve Bennett1-5/+0
To warn of Y2038 problems, and suggest use of -D__MINGW_USE_VC2005_COMPAT on mingw32. Do this instead of the previous runtime test. Add -D__MINGW_USE_VC2005_COMPAT to the appveyor build. Fixes msteveb/jimtcl#145 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-03-04clock: test and doc non-Y2038 complianceSteve Bennett1-0/+5
Add a note in the documentation for clock that some systems use 32-bit time_t and are thus not year 2038 compliant. Also add a test to catch this in clock.test Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-12-30regexp: Reset scanner position on failed optional groupSteve Bennett1-0/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-12-13tests: Fix misc.test for new return -level 0 behaviourSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-12-13return: fix -level 0 -code xxxSteve Bennett1-2/+9
Should return the given return code, not JIM_RETURN (2) Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-30string map and string compare now support embedded nullsSteve Bennett1-0/+21
Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-11json: implement -index decode optiondbohdan1-0/+24
2019-11-09json: Fix decode schema for list objSteve Bennett1-0/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-09json: Add json encoder/decoderSteve Bennett1-0/+146
Using the jsmn library for decoding. Based on the original implementation by Svyatoslav Mishyn <juef@openmailbox.org> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-06expr-sugar: $() should return non-error codesSteve Bennett1-0/+5
If an expression returns (e.g.), break, continue or exit, that return code should be propagated, the same it is for [expr {}] Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-10-27regexp -indices should return character indicesSteve Bennett1-0/+4
Not byte indices Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-10-27regexp, regsub: -start is a character indexSteve Bennett1-1/+6
Not a byte index Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-10-18file: Add file splitSteve Bennett1-0/+5
This subcommand was missing as it wasn't part of the original Tcl 6.7 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-10-18file: Better support for trailing slashes in pathnamesSteve Bennett2-84/+151
e.g. file tail /abc/def/ => def Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-09-06signal: Add 'signal block' supportSteve Bennett1-7/+25
This allows a signal to be blocked by setting it's handler to SIG_IGN Can be used to block SIGPIPE for exec Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-07-31aio: Add support for lock -waitSteve Bennett1-0/+13
Sometimes it is useful to wait for a lock to become available. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2018-09-21lreplace: Implement TIP #505Steve Bennett1-3/+83
More consistent behaviour of replacing past end of list Signed-off-by: Steve Bennett <steveb@workware.net.au>
2018-07-25Update autosetup to v0.6.8Steve Bennett2-11/+13
autosetup changes: - The syntax for templates has changed slightly - Update config.guess and config.sub to 2018-03-08 - Add rpath support - Add --runstatedir Also: - enable rpath when building libjim as shared - ensure that 'make test' works on MacOS when libjim is shared Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-12-31utf8: Be more strict at rejecting invalid UTF-8 sequences.Steve Bennett2-20/+5
RFC 3629 says: Implementations of the decoding algorithm above MUST protect against decoding invalid sequences Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-12-31regexp: Implement class shorthand escapes in bracketsSteve Bennett1-0/+1
The following class shorthand escapes now match Tcl when used within bracket expressions: \d [[:digit:]] \s [[:space:]] \w [[:alnum:]_] (note underscore) e.g. [a-f\d] => [a-f0-9] Previously these shorthand escapes were only implemented outside bracket expressions. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-11-29tests: clock.test needs cmd clockSteve Bennett1-0/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-11-26tests: Make the failing SIGPIPE tests go away on AppVeyorSteve Bennett1-1/+7
Work around the problem by skipping the test Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-11-25tests: remove debugging from event.testSteve Bennett1-2/+0
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-11-25tests: If ipv6 sockets can't be bound, don't testSteve Bennett1-2/+15
This is a workaround for IPv6 tests failing on Travis Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-11-04tests: exec2-3.2 now passes on OpenBSDSteve Bennett1-3/+3
Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-21tests: Use a more explicit approach to test SIGPIPESteve Bennett1-2/+8
Write to a closed pipe in exec2-3.2 to force SIGPIPE Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-17tests: Try to fix exec2-3.2 on WindowsSteve Bennett1-2/+2
On some mingw platforms exec2-3.2 isn't producing SIGPIPE Try to make it do so. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-17signal, exec, wait, pid: improvements, especially to execSteve Bennett3-9/+55
- fix popen [open "|pipeline ..."] to return meaningful status in close (but note that stderr is not captured) - popen pipelines can now be used as the target of exec redirection - overally improvements to exec on windows. Now crt file descriptors are used throughout - add support for [pid], [wait] and popen on windows - os.wait is now wait, and integrates with [exec ... &] to be able to wait for running background tasks - [socket pipe] is now also [pipe] and is supported on windows - [file tempfile] is supported on windows - move duplicated code between jim-aio.c and jim-exec.c to jimiocompat.c - Fix [exec] on windows to match unix semantics wrt sharing the parent stream unless redirected rather than using /dev/null - On windows redirect to or from /dev/null is automatically converted to NUL: - If signal support is disabled, implement a minimal Jim_SignalId() for exec and wait - aio now supports getfd, to return the underlying file descriptor. This is used by exec to support redirection, and allows popen channels to support exec redirection. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-21prefix.test: Use the correct package nameSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-15Implement defer, $jim::deferSteve Bennett1-0/+237
Allows commands to run when a proc or interpreter exits. If the $jim::defer variables exists at proc or interp exit, it is treated as a list of scripts to evaluate (in reverse order). The [defer] command is a helper to add scripts to $jim::defer See tests/defer.test Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-01tests: binary tests require pack on jimSteve Bennett1-0/+3
Avoid failing many tests if binary.tcl is available put pack isn't enabled. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-01Support lambda even if references are disabledSteve Bennett1-2/+2
It's convenient to support a non-gc lambda, even if references are disabled. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-08-27tests/timer.test: Remove timer-6.5Steve Bennett1-10/+1
This test is essentially the same as timer-6.4 except with tighter timing requirements. Remove it to prevent spurious failures. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-08-27tests/exec.test: Minor fix for exec-12.1 on hurdSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-08-03tree: Allow nodes to be deletedSteve Bennett1-0/+15
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-08-03Error on extra characters after close braceSteve Bennett2-3/+6
In scripts, like Tcl does. Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: tcler.yin
2017-05-30expr: Ensure that non-zero return codes are passed throughSteve Bennett1-0/+13
Non-zero return codes (e.g. break, continue, exit) were all being converted to the error code. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-23expr: Replace expression engineSteve Bennett1-0/+8
Rework the expression engine to use recursive descent evaluation rather than a shunting yard algorithm. Among other things, it is easier to make lazy operators and the ternary operator work correctly. In particular, the following expression no longer crashes: $(99?9,99?9:*9:999)?9) And the code is now smaller. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Fix clock format on mingw platformsSteve Bennett1-2/+2
gmtime() fails for negative time_t values. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Fix test for platforms with no scan supportSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Add -gmt option to format and scanSteve Bennett1-0/+52
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07expr: Add better checks for invalid ternary expressionSteve Bennett1-1/+1
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-11-14dict: Fix [dict values] with duplicate valuesSteve Bennett1-0/+1
The script implementation of dict values was not correctly handling the case where a dictionary had duplicate values. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-12Array fixes and testsEvan Hunter1-0/+46
Changed 'array exists' to actually check if the variable is an array (matches tclsh) Fix Jim_DictInfo to avoid using printf() and make output match tclsh Added some more tests for array command - checked these work with tclsh
2016-10-11Separate out Jim specific testsEvan Hunter3-10/+36
2016-10-09Add more tests for zlibEvan Hunter1-0/+21
2016-10-05dict: dict replace with one arg is not stableSteve Bennett1-1/+1
Fix dict2.test/dict-4.1 Even with no key/values given, the order of the returned dictionary is not guaranteed. Reported-by: Evan Hunter <evan@ozhiker.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-10-02Add some tests for paths identified as untested by gcov.Evan Hunter3-0/+18
Also prune a 'break' which was unreachable.
2016-09-28tests/runall: don't abort if signal.test exitsSteve Bennett1-1/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-28tcltest: do a better job of cleanup up after testsSteve Bennett1-28/+0
In particular, glob2.test was leaving a lot of litter Signed-off-by: Steve Bennett <steveb@workware.net.au>