Diff
Not logged in

Differences From Artifact [c9d2b2b23a]:

To Artifact [167852d0ad]:


1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19











-
+







# reg.test --
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands.  Sourcing this file into Tcl runs the tests and
# generates output for errors.  No output means no errors were found.
# (Don't panic if you are seeing this as part of the reg distribution
# and aren't using Tcl -- reg's own regression tester also knows how
# to read this file, ignoring the Tcl-isms.)
#
# Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
#
# RCS: @(#) $Id: reg.test,v 1.19 2003/11/14 20:44:47 dgp Exp $
# RCS: @(#) $Id: reg.test,v 1.20 2003/11/17 17:48:17 dgp Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# All tests require the testregexp command, return if this
1078
1079
1080
1081
1082
1083
1084
1085















































1086
1087
1088
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135








+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+



test reg-32.9 {canmatch functionality -- more complex case} {knownBug} {
    set pat {((\B\B|\Bh+line)[ \t]*|[^\B]%[^\r\n]*)$}
    set line "asd asd"
    # can match at the final d, if '%' follows
    set res [testregexp -xflags -- c $pat $line resvar]
    lappend res $resvar
} {0 6}

# Tests reg-33.*: Checks for bug fixes

test reg-33.1 {Bug 230589} {
    regexp {[ ]*(^|[^%])%V} "*%V2" m s
} 1

test reg-33.2 {Bug 504785} {
    regexp -inline {([^_.]*)([^.]*)\.(..)(.).*} bbcos_001_c01.q1la
} {bbcos_001_c01.q1la bbcos _001_c01 q1 l}

test reg-33.3 {Bug 505048} {
    regexp {\A\s*[^<]*\s*<([^>]+)>} a<a>
} 1

test reg-33.4 {Bug 505048} {
    regexp {\A\s*([^b]*)b} ab
} 1

test reg-33.5 {Bug 505048} {
    regexp {\A\s*[^b]*(b)} ab
} 1

test reg-33.6 {Bug 505048} {
    regexp {\A(\s*)[^b]*(b)} ab
} 1

test reg-33.7 {Bug 505048} {
    regexp {\A\s*[^b]*b} ab
} 1

test reg-33.8 {Bug 505048} {
    regexp -inline {\A\s*[^b]*b} ab
} ab

test reg-33.9 {Bug 505048} {
    regexp -indices -inline {\A\s*[^b]*b} ab
} {{0 1}}

test reg-33.10 {Bug 840258} {
    regsub {(^|\n)+\.*b} \n.b {} tmp
} 1

test reg-33.11 {Bug 840258} {
    regsub {(^|[\n\r]+)\.*\?<.*?(\n|\r)+} \
	    "TQ\r\n.?<5000267>Test already stopped\r\n" {} tmp
} 1

# cleanup
::tcltest::cleanupTests
return