summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2012-09-12 17:42:59 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2012-09-12 17:42:59 (GMT)
commite44afcc1bcc88271f5d95b7c48320455689a3ae3 (patch)
treefd1305621758fdeca65c0e1b6deac4840f3d2f0d /tests
parentb50a5c6126831173b2c608822744eaf9fb3b5127 (diff)
downloadtcl-e44afcc1bcc88271f5d95b7c48320455689a3ae3.zip
tcl-e44afcc1bcc88271f5d95b7c48320455689a3ae3.tar.gz
tcl-e44afcc1bcc88271f5d95b7c48320455689a3ae3.tar.bz2
tip#404 file locale mcset: mc(fl)(m)set backport from 8.6
Diffstat (limited to 'tests')
-rw-r--r--tests/msgcat.test44
1 files changed, 42 insertions, 2 deletions
diff --git a/tests/msgcat.test b/tests/msgcat.test
index bbcd023..d75bf8e 100644
--- a/tests/msgcat.test
+++ b/tests/msgcat.test
@@ -17,8 +17,8 @@ if {[catch {package require tcltest 2}]} {
puts stderr "Skipping tests in [info script]. tcltest 2 required."
return
}
-if {[catch {package require msgcat 1.4.5}]} {
- puts stderr "Skipping tests in [info script]. No msgcat 1.4.5 found to test."
+if {[catch {package require msgcat 1.5.0}]} {
+ puts stderr "Skipping tests in [info script]. No msgcat 1.5.0 found to test."
return
}
@@ -611,6 +611,46 @@ namespace eval ::msgcat::test {
mc "this is a %s" "good test"
} -result "this is a good test"
+ # Tests msgcat-8.*: [mcflset]
+
+ set msgdir1 [makeDirectory msgdir1]
+ makeFile {::msgcat::mcflset k1 v1} l1.msg $msgdir1
+
+ test msgcat-8.1 {mcflset} -setup {
+ variable locale [mclocale]
+ mclocale l1
+ mcload $msgdir1
+ } -cleanup {
+ mclocale $locale
+ } -body {
+ mc k1
+ } -result v1
+
+ removeFile l1.msg $msgdir1
+ removeDirectory msgdir1
+
+ set msgdir2 [makeDirectory msgdir2]
+ set msgdir3 [makeDirectory msgdir3]
+ makeFile "::msgcat::mcflset k2 v2 ; ::msgcat::mcload [list $msgdir3]"\
+ l2.msg $msgdir2
+ makeFile {::msgcat::mcflset k3 v3} l2.msg $msgdir3
+
+ # chained mcload
+ test msgcat-8.2 {mcflset} -setup {
+ variable locale [mclocale]
+ mclocale l2
+ mcload $msgdir2
+ } -cleanup {
+ mclocale $locale
+ } -body {
+ return [mc k2][mc k3]
+ } -result v2v3
+
+ removeFile l2.msg $msgdir2
+ removeDirectory msgdir2
+ removeFile l3.msg $msgdir3
+ removeDirectory msgdir3
+
cleanupTests
}
namespace delete ::msgcat::test