summaryrefslogtreecommitdiffstats
path: root/tests/option.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-10-25 22:00:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-10-25 22:00:54 (GMT)
commit6517ea57da28dce9742a12980122acc1c59a5671 (patch)
tree44adfb486b7d1a745d56daa95b597a89e4b0fb7c /tests/option.test
parent4b830288d02e49fa96ed7b5d20bf8170297abcba (diff)
downloadtk-6517ea57da28dce9742a12980122acc1c59a5671.zip
tk-6517ea57da28dce9742a12980122acc1c59a5671.tar.gz
tk-6517ea57da28dce9742a12980122acc1c59a5671.tar.bz2
Fix [477949]: option readfile cannot use multibytes.
Implementation adopted from AndroWish, but added support for UTF-8 BOM and added test-case.
Diffstat (limited to 'tests/option.test')
-rw-r--r--tests/option.test11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/option.test b/tests/option.test
index 1bfcb7c..4668771 100644
--- a/tests/option.test
+++ b/tests/option.test
@@ -187,6 +187,7 @@ test option-14.12 {error conditions} {
set option1 [file join [testsDirectory] option.file1]
set option2 [file join [testsDirectory] option.file2]
+set option3 [file join [testsDirectory] option.file3]
test option-15.1 {database files} {
list [catch {option read non-existent} msg] $msg
@@ -207,16 +208,18 @@ test option-15.9 {database files} {option get . x3 color} burgundy
test option-15.10 {database files} {
list [catch {option read $option2} msg] $msg
} {1 {missing colon on line 2}}
+option read $option3
+test option-15.11 {database files} {option get . {x 4} color} br\xf3wn
test option-16.1 {ReadOptionFile} {
- set option3 [makeFile {} option.file3]
- set file [open $option3 w]
+ set option4 [makeFile {} option.file3]
+ set file [open $option4 w]
fconfigure $file -translation crlf
puts $file "*x7: true\n*x8: false"
close $file
- option read $option3 userDefault
+ option read $option4 userDefault
set result [list [option get . x7 color] [option get . x8 color]]
- removeFile $option3
+ removeFile $option4
set result
} {true false}