Tcl Source Code

Check-in [e43056cf4a]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Correcting the string tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-501
Files: files | file ages | folders
SHA3-256:e43056cf4a16a9171a4cbd0c5e13da5f661a65905622fd9a6d848132491092a3
User & Date: hypnotoad 2018-02-13 19:22:31
Context
2018-11-06
10:04
merge core-8-branch check-in: 33398e15df user: dkf tags: tip-501
2018-02-13
19:22
Correcting the string tests check-in: e43056cf4a user: hypnotoad tags: tip-501
19:10
Ok.. that was all it needed check-in: e144efef26 user: hypnotoad tags: tip-501
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/string.test.

1997
1998
1999
2000
2001
2002
2003
2004
2005




2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017




2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030




2031
2032




2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
    set r1 [string compare $xx [subst $vv]]
    set r2 [string compare $xx [eval "string cat $vvs"]]
    list $r1 $r2
} {0 0}


test string-30.1 {string is dict} {
    string is dict {a b c}
} 1




test string-30.2 {string is dict} {
    string is dict "a \{b c"
} 0
test string-30.3 {string is dict} {
    string is dict {a {b c}d e}
} 0
test string-30.4 {string is dict} {
    string is dict {}
} 1
test string-30.5 {string is dict} {
    string is dict -strict {a b c}
} 1




test string-30.6 {string is dict} {
    string is dict -strict "a \{b c"
} 0
test string-30.7 {string is dict} {
    string is dict -strict {a {b c}d e}
} 0
test string-30.8 {string is dict} {
    string is dict -strict {}
} 1
test string-30.9 {string is dict} {
    set x {}
    list [string is dict -failindex x {a b c}] $x
} {1 {}}




test string-30.10 {string is dict} {
    set x {}




    list [string is dict -failindex x "a \{b c"] $x
} {0 2}
test string-30.11 {string is dict} {
    set x {}
    list [string is dict -failindex x {a b {b c}d e}] $x
} {0 4}
test string-30.12 {string is dict} {
    set x {}
    list [string is dict -failindex x {}] $x
} {1 {}}
test string-30.13 {string is dict} {
    set x {}
    list [string is dict -failindex x {  {b c}d e}] $x
} {0 2}
test string-30.14 {string is dict} {
    set x {}
    list [string is dict -failindex x "\uabcd {b c}d e"] $x
} {0 2}
test string-30.15 {string is dict, valid dict} {
    string is dict {a b c d e f}
} 1
test string-30.16 {string is dict, invalid dict} {
    string is dict a
} 0
test string-30.17 {string is dict, valid dict packed in invalid dict} {







|

>
>
>
>










|

>
>
>
>











|

>
>
>
>


>
>
>
>

|



|







|



|







1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
    set r1 [string compare $xx [subst $vv]]
    set r2 [string compare $xx [eval "string cat $vvs"]]
    list $r1 $r2
} {0 0}


test string-30.1 {string is dict} {
    string is dict {a b c d}
} 1
test string-30.1a {string is dict} {
    string is dict {a b c}
} 0

test string-30.2 {string is dict} {
    string is dict "a \{b c"
} 0
test string-30.3 {string is dict} {
    string is dict {a {b c}d e}
} 0
test string-30.4 {string is dict} {
    string is dict {}
} 1
test string-30.5 {string is dict} {
    string is dict -strict {a b c d}
} 1
test string-30.5a {string is dict} {
    string is dict -strict {a b c}
} 0

test string-30.6 {string is dict} {
    string is dict -strict "a \{b c"
} 0
test string-30.7 {string is dict} {
    string is dict -strict {a {b c}d e}
} 0
test string-30.8 {string is dict} {
    string is dict -strict {}
} 1
test string-30.9 {string is dict} {
    set x {}
    list [string is dict -failindex x {a b c d}] $x
} {1 {}}
test string-30.9a {string is dict} {
    set x {}
    list [string is dict -failindex x {a b c}] $x
} {0 0}
test string-30.10 {string is dict} {
    set x {}
    list [string is dict -failindex x "a \{b c d"] $x
} {0 0}
test string-30.10a {string is dict} {
    set x {}
    list [string is dict -failindex x "a \{b c"] $x
} {0 0}
test string-30.11 {string is dict} {
    set x {}
    list [string is dict -failindex x {a b {b c}d e}] $x
} {0 0}
test string-30.12 {string is dict} {
    set x {}
    list [string is dict -failindex x {}] $x
} {1 {}}
test string-30.13 {string is dict} {
    set x {}
    list [string is dict -failindex x {  {b c}d e}] $x
} {0 0}
test string-30.14 {string is dict} {
    set x {}
    list [string is dict -failindex x "\uabcd {b c}d e"] $x
} {0 0}
test string-30.15 {string is dict, valid dict} {
    string is dict {a b c d e f}
} 1
test string-30.16 {string is dict, invalid dict} {
    string is dict a
} 0
test string-30.17 {string is dict, valid dict packed in invalid dict} {