aboutsummaryrefslogtreecommitdiff
path: root/tests/string.test
AgeCommit message (Collapse)AuthorFilesLines
2020-12-26core: commands that take an index now use integer expressionsSteve Bennett1-3/+3
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-07-12string last: fix segfault with invalid indexSteve Bennett1-0/+3
[string last foo bar -1] gave segfault due to missing check for invalid index. Fixes #161 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-06-05core: string match and other glob matching support embedded nullsSteve Bennett1-0/+11
string match, switch -glob, info commands, etc. all now support patterns and strings with embedded nulls. Fixes #143 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17tests: improve code coverageSteve Bennett1-0/+40
- clock - array - file tempfile - lreverse - string byterange - aio tty 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>
2016-07-10Boolean contstants in expr, `string is boolean` classificationNikita Borodikhin1-3/+35
* named boolean values in `expr` are internally converted to int * named constants are lower-case only
2014-11-17Implement string cat (TIP #429)Steve Bennett1-2/+19
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-09-19Build on platforms without isasciiSteve Bennett1-0/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: Paul Fertser <fercerpav@gmail.com>
2013-02-15Fix [string replace] replacing single charSteve Bennett1-0/+50
Also added some additional tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-09-11Add support for string {equal,compare} -lengthSteve Bennett1-15/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-08-07Remove octal literals with a leading 0 (TIP #114)Steve Bennett1-1/+1
Now an octal literal needs to be explicitly indicated with a leading 0o or 0O, otherwise the number is treated as decimal. This patch also adds support for binary literals. e.g. 0b101 0B1101 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-28Implement [string replace]Steve Bennett1-0/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-28Add support for [string totitle]Steve Bennett1-0/+13
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-05-23Improve list parsingSteve Bennett1-0/+18
Also add additional tests Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-04-21string trim is now 8 bit cleanSteve Bennett1-0/+15
i.e. supports embedded nulls Also now supports utf-8 trim chars Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-01-24Jim 'string is' doesn't work with unicodeSteve Bennett1-1/+1
So just disable this test Reported-by: Paulo Ferreira <paf@keeh.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-14Fix constraint checkingSteve Bennett1-1/+1
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-11-22Overhaul unit test frameworkSteve Bennett1-27/+23
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-17Add UTF-8 support to JimSteve Bennett1-8/+10
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Move test.tcl to tests/jim.testSteve Bennett1-3/+3
And other small testing improvements 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-15Many improvements, bug fixesSteve Bennett1-0/+651
*: Allow math functions to be enabled via configure *: Allow support for references to be removed *: Documentation updates *: Jim_ListLength() now returns the result directly *: Optimise list -> dict conversion *: Consistent capitalisation of some structures, functions *: Add support for abbreviations to Jim_GetEnum() *: The commands to 'info' may be abbreviated *: Use abbreviation support in parsing options to 'subst' *: Use Jim_GetEnum() to parse return code names *: Optimise 'array get', 'array set' if no conversion needed *: Import Tcl string.test *: string compare now returns -1,0,1 like Tcl *: Fix 'string last' with index=0 *: Add support for 'string reverse' *: Add -nocase option to 'string equal' *: Fix infinite loop in 'string repeat str -1' *: Support braced patterns in glob *: glob should not return dot files unless the pattern starts with . *: Simplify glob.tcl by using some new features *: When creating C extensions from Tcl, preserve newlines and invoke with Jim_Eval_Named() to produce more meaningful error messages. *: Also remove all comments, not just those starting in the first column *: Add support for 'n+n' and 'n-n' in string/list indexes (Tcl 8.5) *: Add a level to the stack trace for 'return -code error' *: 'return -code' should also affect the return from 'source' (see Tcl docs) *: Fix lsort -command *: Some systems don't have INFINITY