aboutsummaryrefslogtreecommitdiff
path: root/tests/regexp.test
AgeCommit message (Collapse)AuthorFilesLines
2023-07-04tcltest: rework constraint systemSteve Bennett1-1/+1
Now 'constraint cmd|package' is like 'needs' but sets a constraint The command to 'needs cmd' and 'constraint cmd' can now take a subcommand to check. Add 'constraint|needs eval|expr' to make some constraint checks simpler. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-04-19regexp: fix incorrect check for invalid escape sequence at end of charsetSteve Bennett1-0/+4
Fixes #259 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-04-19regexp: fix check for termination in [[:class:]]Steve Bennett1-0/+4
Fixes #259 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-12-26core: commands that take an index now use integer expressionsSteve Bennett1-2/+2
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>
2020-05-04regsub: Fix regsub -all with \ASteve Bennett1-5/+5
regsub -all matches \A against the start of each match, but correctly handle a pattern like ^ which does not advance the match Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04regexp: Improved error messageSteve Bennett1-5/+4
Detect and produce an error for missing closing bracket ] Consider a trailing backslash as an invalid escape Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04tests: Add many new additional tests for code coverageSteve Bennett1-0/+82
readdir, tty, utf8, signal, alarm, kill, file, jimsh, posix, aio, history, interp, pack, unpack, eventloop, exec, load, package, regexp, regsub 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>
2016-10-02Add some tests for paths identified as untested by gcov.Evan Hunter1-0/+8
Also prune a 'break' which was unreachable.
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-02-02regexp: Enable additional regexp/regsub testsSteve Bennett1-63/+72
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>
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>
2010-12-14Platform differences for regexp messagesSteve Bennett1-4/+4
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-22Overhaul unit test frameworkSteve Bennett1-14/+15
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-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 Bennett1-7/+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-15Skip tests for features which are not availableSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Small improvements to testsSteve Bennett1-2/+0
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-15Build improvements, bug fixes and compiler warningsSteve Bennett1-4/+3
Remove unimplemented 'after restart|expire' from eventloop Allow libjim to be build as a shared library On some platforms, regex.h needs stdlib.h first Use ualarm() only for times < 1 second Fix warnings found by clang static analyser *: printf/syslog %m isn't portable *: some variables set but never read *: some possible null pointer references (although mostly impossible) *: also minor fixes to jim unit tests Fix 'syslog -options <n>' Must null terminate readlink() result
2010-10-15Implement unix domain sockets for socketSteve Bennett1-0/+8
*: aio.socket now supports unix and unix.server *: Also, rename aio.open as open and aio.socket as socket
2010-10-15Bugs, features and testsSteve Bennett1-0/+35
source fails with zero length file unknown can't be called recursively *: This can be useful when using unknown to dynamically load code, which may in turn want to dynamically load code *: Limit it to 50 recursions though Allow string greater/less comparison *: Comparing two strings for order did not work Implement file join *: It's not to hard and is handy when working with the current dir, "" Don't omit [unknown] completely from stack trace *: Since we lose valuable informtion, just omit the name Fix return from case Turn regexp patterns into real objects *: Thus caching the compiled regexps Allow error to rethrow an error Replace bcopy() with more standard memcpy() Fixes to parray, improve errorInfo *: errorInfo takes an optional stack trace Add tests for rethrowing errors via errorInfo Fix ndelay *: Was looking at wrong param *: Also fix usage/help for aio.socket Package should be able to call exit *: Currently any return from a package is changed to JIM_ERR Line counting is incorrect for backlash newline