diff options
author | dgp <dgp@users.sourceforge.net> | 2017-11-14 14:48:21 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-11-14 14:48:21 (GMT) |
commit | 2ea108ae28d6cb28d46755af67cc177af111e34c (patch) | |
tree | 4e5d83d0d9fde91b839910db8bd9817a2d714185 /tests/package.test | |
parent | eb2a9484b8c88857536ea0ea90fb97dac3f7f3b9 (diff) | |
parent | d7b5cde35f263aac98a4bdfbfa76afde358476d8 (diff) | |
download | tcl-2ea108ae28d6cb28d46755af67cc177af111e34c.zip tcl-2ea108ae28d6cb28d46755af67cc177af111e34c.tar.gz tcl-2ea108ae28d6cb28d46755af67cc177af111e34c.tar.bz2 |
[5d6de65036] [package require] with [package prefer stable] was not choosing available stable package.
Diffstat (limited to 'tests/package.test')
-rw-r--r-- | tests/package.test | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/tests/package.test b/tests/package.test index 99f9f06..faa15ec 100644 --- a/tests/package.test +++ b/tests/package.test @@ -139,7 +139,7 @@ test package-3.1 {Tcl_PkgRequire procedure, picking best version} -setup { package ifneeded t $i "set x $i; package provide t $i" } package require t - return $x + set x } -result {3.4} test package-3.2 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t @@ -149,7 +149,7 @@ test package-3.2 {Tcl_PkgRequire procedure, picking best version} -setup { package ifneeded t $i "set x $i; package provide t $i" } package require t - return $x + set x } -result {3.5} test package-3.3 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t @@ -159,7 +159,7 @@ test package-3.3 {Tcl_PkgRequire procedure, picking best version} -setup { package ifneeded t $i "set x $i; package provide t $i" } package require t 2.2 - return $x + set x } -result {2.3} test package-3.4 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t @@ -169,7 +169,7 @@ test package-3.4 {Tcl_PkgRequire procedure, picking best version} -setup { package ifneeded t $i "set x $i; package provide t $i" } package require -exact t 2.3 - return $x + set x } -result {2.3} test package-3.5 {Tcl_PkgRequire procedure, picking best version} -setup { package forget t @@ -179,7 +179,7 @@ test package-3.5 {Tcl_PkgRequire procedure, picking best version} -setup { package ifneeded t $i "set x $i; package provide t $i" } package require t 2.1 - return $x + set x } -result {2.4} test package-3.6 {Tcl_PkgRequire procedure, can't find suitable version} -setup { package forget t @@ -238,7 +238,7 @@ test package-3.12 {Tcl_PkgRequire procedure, self-deleting script} -setup { } -body { package ifneeded t 1.2 "package forget t; set x 1.2; package provide t 1.2" package require t 1.2 - return $x + set x } -result {1.2} test package-3.13 {Tcl_PkgRequire procedure, "package unknown" support} -setup { package forget t @@ -256,7 +256,7 @@ test package-3.13 {Tcl_PkgRequire procedure, "package unknown" support} -setup { } package unknown pkgUnknown package require -exact t 1.5 - return $x + set x } -cleanup { package unknown {} } -result {t 1.5-1.5} @@ -283,7 +283,7 @@ test package-3.15 {Tcl_PkgRequire procedure, "package unknown" support} -setup { package provide [lindex $args 0] 2.0 } package require {a b} - return $x + set x } -cleanup { package unknown {} } -result {{a b} 0-} @@ -583,7 +583,7 @@ test package-3.50 {Tcl_PkgRequire procedure, picking best stable version} -const package ifneeded t $i "set x $i; package provide t $i" } package require t - return $x + set x } -result {3.4} test package-3.51 {Tcl_PkgRequire procedure, picking best stable version} -setup { package forget t @@ -593,7 +593,7 @@ test package-3.51 {Tcl_PkgRequire procedure, picking best stable version} -setup package ifneeded t $i "set x $i; package provide t $i" } package require t - return $x + set x } -result {1.3} test package-3.52 {Tcl_PkgRequire procedure, picking best stable version} -setup { package forget t @@ -603,8 +603,20 @@ test package-3.52 {Tcl_PkgRequire procedure, picking best stable version} -setup package ifneeded t $i "set x $i; package provide t $i" } package require t - return $x + set x } -result {1.3} +test pkg-3.53 {Tcl_PkgRequire procedure, picking best stable version} -constraints testpreferstable -setup { + testpreferstable + package forget t + set x xxx +} -body { + foreach i {1.2b1 1.1} { + package ifneeded t $i "set x $i; package provide t $i" + } + package require t + set x +} -result {1.1} + test package-4.1 {Tcl_PackageCmd procedure} -returnCodes error -body { package |