diff options
author | dgp <dgp@users.sourceforge.net> | 2014-02-18 17:54:06 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-02-18 17:54:06 (GMT) |
commit | abe90f6c1b82d92b9e000f861edde447cf1d7863 (patch) | |
tree | 14e81d029cc4c11f8669eae6ea9cb099aade58aa | |
parent | d212e3e191d59aea969df3987426e85d086da364 (diff) | |
download | tcl-abe90f6c1b82d92b9e000f861edde447cf1d7863.zip tcl-abe90f6c1b82d92b9e000f861edde447cf1d7863.tar.gz tcl-abe90f6c1b82d92b9e000f861edde447cf1d7863.tar.bz2 |
Coverage test for -translation auto handling of INPUT_SAW_CR flag.
Demonstrates refactor failure.
-rw-r--r-- | generic/tclIO.c | 1 | ||||
-rw-r--r-- | tests/io.test | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 09b8191..20101c2 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -8949,7 +8949,6 @@ CopyAndTranslateBuffer( for (src = result; src < end; src++) { curByte = *src; if (curByte == '\r') { - Tcl_Panic("Untested"); SetFlag(statePtr, INPUT_SAW_CR); *dst = '\n'; dst++; diff --git a/tests/io.test b/tests/io.test index 68051d7..e08c57a 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6730,6 +6730,21 @@ test io-52.11 {TclCopyChannel & encodings} {fcopy} { file size $path(kyrillic.txt) } 3 +test io-52.12 {coverage of -translation auto} { + file delete $path(test1) $path(test2) + set out [open $path(test1) wb] + chan configure $out -translation lf + puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz + close $out + set in [open $path(test1)] + chan configure $in -buffersize 8 + set out [open $path(test2) w] + fcopy $in $out + close $in + close $out + file size $path(test2) +} 29 + test io-53.1 {CopyData} {fcopy} { file delete $path(test1) set f1 [open $thisScript] |