diff options
author | dgp <dgp@users.sourceforge.net> | 2014-05-16 15:23:26 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-05-16 15:23:26 (GMT) |
commit | 0cfd3ae90e7df33b8acac2536459f34060f5e191 (patch) | |
tree | 40b47310a803f65ccca24ee2dd818ee3c2ba2989 /tests | |
parent | aae8ddb7559427cdda66c3ee2ac36ef3b0c40a05 (diff) | |
parent | 2c48da76fc7efc47bef33eff275ecfbf80ccd2a8 (diff) | |
download | tcl-0cfd3ae90e7df33b8acac2536459f34060f5e191.zip tcl-0cfd3ae90e7df33b8acac2536459f34060f5e191.tar.gz tcl-0cfd3ae90e7df33b8acac2536459f34060f5e191.tar.bz2 |
merge trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/io.test | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/io.test b/tests/io.test index 8dd7184..adcc3da 100644 --- a/tests/io.test +++ b/tests/io.test @@ -1563,6 +1563,45 @@ test io-13.8 {TranslateInputEOL: auto mode: \r\n} { close $f set x } "abcd\ndef" +test io-13.8.1 {TranslateInputEOL: auto mode: \r\n} { + set f [open $path(test1) w] + fconfigure $f -translation lf + puts -nonewline $f "abcd\r\ndef" + close $f + set f [open $path(test1)] + fconfigure $f -translation auto + set x {} + lappend x [read $f 5] + lappend x [read $f] + close $f + set x +} [list "abcd\n" "def"] +test io-13.8.2 {TranslateInputEOL: auto mode: \r\n} { + set f [open $path(test1) w] + fconfigure $f -translation lf + puts -nonewline $f "abcd\r\ndef" + close $f + set f [open $path(test1)] + fconfigure $f -translation auto -buffersize 6 + set x {} + lappend x [read $f 5] + lappend x [read $f] + close $f + set x +} [list "abcd\n" "def"] +test io-13.8.3 {TranslateInputEOL: auto mode: \r\n} { + set f [open $path(test1) w] + fconfigure $f -translation lf + puts -nonewline $f "abcd\r\n\r\ndef" + close $f + set f [open $path(test1)] + fconfigure $f -translation auto -buffersize 7 + set x {} + lappend x [read $f 5] + lappend x [read $f] + close $f + set x +} [list "abcd\n" "\ndef"] test io-13.9 {TranslateInputEOL: auto mode: \r followed by not \n} { set f [open $path(test1) w] fconfigure $f -translation lf @@ -3984,6 +4023,46 @@ test io-32.11 {Tcl_Read from a pipe} {stdio openpipe} { } {{hello } {hello }} +test io-32.11.1 {Tcl_Read from a pipe} {stdio openpipe} { + file delete $path(pipe) + set f1 [open $path(pipe) w] + puts $f1 {chan configure stdout -translation crlf} + puts $f1 {puts [gets stdin]} + puts $f1 {puts [gets stdin]} + close $f1 + set f1 [open "|[list [interpreter] $path(pipe)]" r+] + puts $f1 hello + flush $f1 + set x "" + lappend x [read $f1 6] + puts $f1 hello + flush $f1 + lappend x [read $f1] + close $f1 + set x +} {{hello +} {hello +}} +test io-32.11.1 {Tcl_Read from a pipe} {stdio openpipe} { + file delete $path(pipe) + set f1 [open $path(pipe) w] + puts $f1 {chan configure stdout -translation crlf} + puts $f1 {puts [gets stdin]} + puts $f1 {puts [gets stdin]} + close $f1 + set f1 [open "|[list [interpreter] $path(pipe)]" r+] + puts $f1 hello + flush $f1 + set x "" + lappend x [read $f1 6] + puts $f1 hello + flush $f1 + lappend x [read $f1] + close $f1 + set x +} {{hello +} {hello +}} test io-32.12 {Tcl_Read, -nonewline} { file delete $path(test1) set f1 [open $path(test1) w] |