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)
commitec48c37cfcfbbd45233696741ce5c7b44b8e43bf (patch)
tree2f6f043866e7af65c844fc0ccbc7cc4f63458e90 /tests/msgcat.test
parent43f16074cb838b5bb19f3504fc9e6c66458fbdf9 (diff)
downloadtcl-ec48c37cfcfbbd45233696741ce5c7b44b8e43bf.zip
tcl-ec48c37cfcfbbd45233696741ce5c7b44b8e43bf.tar.gz
tcl-ec48c37cfcfbbd45233696741ce5c7b44b8e43bf.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