summaryrefslogtreecommitdiffstats
path: root/tests/msgcat.test
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2012-09-07 15:32:15 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2012-09-07 15:32:15 (GMT)
commit47f4e0b416dd3a8379b0fc5178db7ecca5b74eae (patch)
tree2f6f043866e7af65c844fc0ccbc7cc4f63458e90 /tests/msgcat.test
parent108d7b787052c399b19e4a601b7afe09a84a2966 (diff)
downloadtcl-47f4e0b416dd3a8379b0fc5178db7ecca5b74eae.zip
tcl-47f4e0b416dd3a8379b0fc5178db7ecca5b74eae.tar.gz
tcl-47f4e0b416dd3a8379b0fc5178db7ecca5b74eae.tar.bz2
Reentrant mcfl(m)set command, test, document mcflset as recommended for message files
Diffstat (limited to 'tests/msgcat.test')
-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