⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parse.test

📁 tcl是工具命令语言
💻 TEST
📖 第 1 页 / 共 3 页
字号:
} {24 .fg}test parse-13.2 {Tcl_ParseVar procedure, no variable name} {    testparsevar {$}} {{$} {}}test parse-13.3 {Tcl_ParseVar procedure, no variable name} {    testparsevar {$.123}} {{$} .123}test parse-13.4 {Tcl_ParseVar procedure, error looking up variable} {    catch {unset abc}    list [catch {testparsevar {$abc}} msg] $msg} {1 {can't read "abc": no such variable}}test parse-13.5 {Tcl_ParseVar procedure, error looking up variable} {    catch {unset abc}    list [catch {testparsevar {$abc([bogus x y z])}} msg] $msg} {1 {invalid command name "bogus"}}test parse-14.1 {Tcl_ParseBraces procedure, computing string length} {    testparser [bytestring "foo\0 bar"] -1} {- foo 1 simple foo 1 text foo 0 {}}test parse-14.2 {Tcl_ParseBraces procedure, computing string length} {    testparser "foo bar" -1} {- {foo bar} 2 simple foo 1 text foo 0 simple bar 1 text bar 0 {}}test parse-14.3 {Tcl_ParseBraces procedure, words in braces} {    testparser {foo {a $b [concat foo]} {c d}} 0} {- {foo {a $b [concat foo]} {c d}} 3 simple foo 1 text foo 0 simple {{a $b [concat foo]}} 1 text {a $b [concat foo]} 0 simple {{c d}} 1 text {c d} 0 {}}test parse-14.4 {Tcl_ParseBraces procedure, empty nested braces} {    testparser {foo {{}}} 0} {- {foo {{}}} 2 simple foo 1 text foo 0 simple {{{}}} 1 text {{}} 0 {}}test parse-14.5 {Tcl_ParseBraces procedure, nested braces} {    testparser {foo {{a {b} c} {} {d e}}} 0} {- {foo {{a {b} c} {} {d e}}} 2 simple foo 1 text foo 0 simple {{{a {b} c} {} {d e}}} 1 text {{a {b} c} {} {d e}} 0 {}}test parse-14.6 {Tcl_ParseBraces procedure, backslashes in words in braces} {    testparser "foo {a \\n\\\{}" 0} {- {foo {a \n\{}} 2 simple foo 1 text foo 0 simple {{a \n\{}} 1 text {a \n\{} 0 {}}test parse-14.7 {Tcl_ParseBraces procedure, missing continuation line in braces} {    list [catch {testparser "\{abc\\\n" 0} msg] $msg $errorInfo} {1 {missing close-brace} missing\ close-brace\n\ \ \ \ (remainder\ of\ script:\ \"\{abc\\\n\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"\\\{abc\\\\\\n\"\ 0\"}test parse-14.8 {Tcl_ParseBraces procedure, backslash-newline in braces} {    testparser "foo {\\\nx}" 0} {- foo\ \{\\\nx\} 2 simple foo 1 text foo 0 word \{\\\nx\} 2 backslash \\\n 0 text x 0 {}}test parse-14.9 {Tcl_ParseBraces procedure, backslash-newline in braces} {    testparser "foo {a \\\n   b}" 0} {- foo\ \{a\ \\\n\ \ \ b\} 2 simple foo 1 text foo 0 word \{a\ \\\n\ \ \ b\} 3 text {a } 0 backslash \\\n\ \ \  0 text b 0 {}}test parse-14.10 {Tcl_ParseBraces procedure, backslash-newline in braces} {    testparser "foo {xyz\\\n }" 0} {- foo\ \{xyz\\\n\ \} 2 simple foo 1 text foo 0 word \{xyz\\\n\ \} 2 text xyz 0 backslash \\\n\  0 {}}test parse-14.11 {Tcl_ParseBraces procedure, empty braced string} {    testparser {foo {}} 0} {- {foo {}} 2 simple foo 1 text foo 0 simple {{}} 1 text {} 0 {}}test parse-14.12 {Tcl_ParseBraces procedure, missing close brace} {    list [catch {testparser "foo \{xy\\\nz" 0} msg] $msg $errorInfo} {1 {missing close-brace} missing\ close-brace\n\ \ \ \ (remainder\ of\ script:\ \"\{xy\\\nz\")\n\ \ \ \ invoked\ from\ within\n\"testparser\ \"foo\ \\\{xy\\\\\\nz\"\ 0\"}test parse-15.1 {Tcl_ParseQuotedString procedure, computing string length} {    testparser [bytestring "foo\0 bar"] -1} {- foo 1 simple foo 1 text foo 0 {}}test parse-15.2 {Tcl_ParseQuotedString procedure, computing string length} {    testparser "foo bar" -1} {- {foo bar} 2 simple foo 1 text foo 0 simple bar 1 text bar 0 {}}test parse-15.3 {Tcl_ParseQuotedString procedure, word is quoted string} {    testparser {foo "a b c" d "efg";} 0} {- {foo "a b c" d "efg";} 4 simple foo 1 text foo 0 simple {"a b c"} 1 text {a b c} 0 simple d 1 text d 0 simple {"efg"} 1 text efg 0 {}}test parse-15.4 {Tcl_ParseQuotedString procedure, garbage after quoted string} {    list [catch {testparser {foo "a b c"d} 0} msg] $msg $errorInfo} {1 {extra characters after close-quote} {extra characters after close-quote    (remainder of script: "d")    invoked from within"testparser {foo "a b c"d} 0"}}test parse-15.5 {CommandComplete procedure} {    info complete ""} 1test parse-15.6 {CommandComplete procedure} {    info complete "  \n"} 1test parse-15.7 {CommandComplete procedure} {    info complete "abc def"} 1test parse-15.8 {CommandComplete procedure} {    info complete "a b c d e f \t\n"} 1test parse-15.9 {CommandComplete procedure} {    info complete {a b c"d}} 1test parse-15.10 {CommandComplete procedure} {    info complete {a b "c d" e}} 1test parse-15.11 {CommandComplete procedure} {    info complete {a b "c d"}} 1test parse-15.12 {CommandComplete procedure} {    info complete {a b "c d"}} 1test parse-15.13 {CommandComplete procedure} {    info complete {a b "c d}} 0test parse-15.14 {CommandComplete procedure} {    info complete {a b "}} 0test parse-15.15 {CommandComplete procedure} {    info complete {a b "cd"xyz}} 1test parse-15.16 {CommandComplete procedure} {    info complete {a b "c $d() d"}} 1test parse-15.17 {CommandComplete procedure} {    info complete {a b "c $dd("}} 0test parse-15.18 {CommandComplete procedure} {    info complete {a b "c \"}} 0test parse-15.19 {CommandComplete procedure} {    info complete {a b "c [d e f]"}} 1test parse-15.20 {CommandComplete procedure} {    info complete {a b "c [d e f] g"}} 1test parse-15.21 {CommandComplete procedure} {    info complete {a b "c [d e f"}} 0test parse-15.22 {CommandComplete procedure} {    info complete {a {b c d} e}} 1test parse-15.23 {CommandComplete procedure} {    info complete {a {b c d}}} 1test parse-15.24 {CommandComplete procedure} {    info complete "a b\{c d"} 1test parse-15.25 {CommandComplete procedure} {    info complete "a b \{c"} 0test parse-15.26 {CommandComplete procedure} {    info complete "a b \{c{ }"} 0test parse-15.27 {CommandComplete procedure} {    info complete "a b {c d e}xxx"} 1test parse-15.28 {CommandComplete procedure} {    info complete "a b {c \\\{d e}xxx"} 1test parse-15.29 {CommandComplete procedure} {    info complete {a b [ab cd ef]}} 1test parse-15.30 {CommandComplete procedure} {    info complete {a b x[ab][cd][ef] gh}} 1test parse-15.31 {CommandComplete procedure} {    info complete {a b x[ab][cd[ef] gh}} 0test parse-15.32 {CommandComplete procedure} {    info complete {a b x[ gh}} 0test parse-15.33 {CommandComplete procedure} {    info complete {[]]]}} 1test parse-15.34 {CommandComplete procedure} {    info complete {abc x$yyy}} 1test parse-15.35 {CommandComplete procedure} {    info complete "abc x\${abc\[\\d} xyz"} 1test parse-15.36 {CommandComplete procedure} {    info complete "abc x\$\{ xyz"} 0test parse-15.37 {CommandComplete procedure} {    info complete {word $a(xyz)}} 1test parse-15.38 {CommandComplete procedure} {    info complete {word $a(}} 0test parse-15.39 {CommandComplete procedure} {    info complete "set a \\\n"} 0test parse-15.40 {CommandComplete procedure} {    info complete "set a \\\\\n"} 1test parse-15.41 {CommandComplete procedure} {    info complete "set a \\n "} 1test parse-15.42 {CommandComplete procedure} {    info complete "set a \\"} 1test parse-15.43 {CommandComplete procedure} {    info complete "foo \\\n\{"} 0test parse-15.44 {CommandComplete procedure} {    info complete "a\nb\n# \{\n# \{\nc\n"} 1test parse-15.45 {CommandComplete procedure} {    info complete "#Incomplete comment\\\n"} 0test parse-15.46 {CommandComplete procedure} {    info complete "#Incomplete comment\\\nBut now it's complete.\n"} 1test parse-15.47 {CommandComplete procedure} {    info complete "# Complete comment\\\\\n"} 1test parse-15.48 {CommandComplete procedure} {    info complete "abc\\\n def"} 1test parse-15.49 {CommandComplete procedure} {    info complete "abc\\\n "} 1test parse-15.50 {CommandComplete procedure} {    info complete "abc\\\n"} 0test parse-15.51 {CommandComplete procedure} "    info complete \"\\{abc\\}\\{\"" 1test parse-15.52 {CommandComplete procedure} {    info complete "\"abc\"("} 1test parse-15.53 {CommandComplete procedure} "    info complete \" # {\"" 1test parse-15.54 {CommandComplete procedure} "    info complete \"foo bar;# {\"" 1test parse-15.55 {CommandComplete procedure} {    info complete "set x [bytestring \0]; puts hi"} 1test parse-15.56 {CommandComplete procedure} {    info complete "set x [bytestring \0]; \{"} 0test parse-15.57 {CommandComplete procedure} {    info complete "# Comment should be complete command"} 1test parse-15.58 {CommandComplete procedure, memory leaks} {    info complete "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22"} 1test parse-15.58 {CommandComplete procedure} {    # Test for Tcl Bug 684744    info complete [encoding convertfrom identity "\x00;if 1 \{"]} 0test parse-16.1 {Tcl_EvalEx, check termOffset is set correctly for non TCL_OK cases, bug 2535} {    subst {[eval {return foo}]bar}} foobartest parse-17.1 {Correct return codes from errors during substitution} {    catch {eval {w[continue]}}} 4# cleanupcatch {unset a}::tcltest::cleanupTestsreturn

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -