diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-10-25 22:32:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-10-25 22:32:41 (GMT) |
commit | b7b2314173c73b203c1e1e4a933140a088a4b0ec (patch) | |
tree | 16b5653a385b8259c573d8c1ee9ca6391a10bcf1 /tests | |
parent | 61c300d0cd96b4e6c3f77443815ab528df417b61 (diff) | |
parent | 6517ea57da28dce9742a12980122acc1c59a5671 (diff) | |
download | tk-b7b2314173c73b203c1e1e4a933140a088a4b0ec.zip tk-b7b2314173c73b203c1e1e4a933140a088a4b0ec.tar.gz tk-b7b2314173c73b203c1e1e4a933140a088a4b0ec.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')
-rwxr-xr-x | tests/option.file3 | 18 | ||||
-rw-r--r-- | tests/option.test | 12 |
2 files changed, 25 insertions, 5 deletions
diff --git a/tests/option.file3 b/tests/option.file3 new file mode 100755 index 0000000..87f41ae --- /dev/null +++ b/tests/option.file3 @@ -0,0 +1,18 @@ +! This file is a sample option (resource) database used to test +! Tk's option-handling capabilities. + +! Comment line \ + with a backslash-newline sequence embedded in it. + +*x1: blue + tktest.x2 : green +*\ +x3 \ + : pur\ +ple +*x 4: brówn +# More comments, this time delimited by hash-marks. + # Comment-line with space. +*x6: +*x9: \ \ \\\101\n +# comment line as last line of file. diff --git a/tests/option.test b/tests/option.test index 23866d7..ea5b5d1 100644 --- a/tests/option.test +++ b/tests/option.test @@ -399,18 +399,20 @@ test option-15.10 {database files} -body { set option2 [file join [testsDirectory] option.file2] option read $option2 } -returnCodes error -result {missing colon on line 2} - +set option3 [file join [testsDirectory] option.file3] +option read $option3 +test option-15.11 {database files} {option get . {x 4} color} br\xf3wn test option-16.1 {ReadOptionFile} -body { - 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 list [option get . x7 color] [option get . x8 color] } -cleanup { - removeFile $option3 + removeFile $option4 } -result {true false} deleteWindows |