summaryrefslogtreecommitdiffstats
path: root/tests/compExpr.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-11-10 11:55:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-11-10 11:55:34 (GMT)
commit72c49f69099c98bd55334dbad3d68645c72bc707 (patch)
tree0debb19ded04cad467e9517c2299fcb5b41ba197 /tests/compExpr.test
parentfeb336f6b3663f107c978288f063f1e7cf9b2458 (diff)
parent44d6e3ab5ea76fb135058f21fde9dfebdbbd035b (diff)
downloadtcl-72c49f69099c98bd55334dbad3d68645c72bc707.zip
tcl-72c49f69099c98bd55334dbad3d68645c72bc707.tar.gz
tcl-72c49f69099c98bd55334dbad3d68645c72bc707.tar.bz2
Merge 8.7. Tweak "tclreg" directory/library name and tclLoad.c, such that the entry point of the "dde" and "registry" extensions can be guessed correctly
Diffstat (limited to 'tests/compExpr.test')
-rw-r--r--tests/compExpr.test36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/compExpr.test b/tests/compExpr.test
index f6fe333..2222b8d 100644
--- a/tests/compExpr.test
+++ b/tests/compExpr.test
@@ -371,10 +371,46 @@ test compExpr-7.2 {[Bug 1869989]: expr parser memleak} -constraints memory -setu
unset end i tmp
rename getbytes {}
} -result 0
+
+proc extract {opcodes descriptor} {
+ set instructions [dict values [dict get $descriptor instructions]]
+ return [lmap i $instructions {
+ if {[lindex $i 0] in $opcodes} {string cat $i} else continue
+ }]
+}
+
+test compExpr-8.1 {TIP 582: expression comments} -setup {} -body {
+ extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
+ $abc
+ # + $def
+ + $ghi
+ }}]
+} -result {loadStk loadStk add}
+test compExpr-8.2 {TIP 582: expression comments} -setup {} -body {
+ extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
+ $abc
+ # + $def
+ # + $ghi }}]
+} -result loadStk
+test compExpr-8.3 {TIP 582: expression comments} -setup {} -body {
+ extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
+ $abc
+ # + $def\
+ + $ghi
+ }}]
+} -result loadStk
+test compExpr-8.4 {TIP 582: expression comments} -setup {} -body {
+ extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
+ $abc
+ # + $def\\
+ + $ghi
+ }}]
+} -result {loadStk loadStk add}
# cleanup
catch {unset a}
catch {unset b}
+catch {rename extract ""}
::tcltest::cleanupTests
return