Posted to tcl by miguel at Thu Nov 05 14:56:57 GMT 2015view raw

  1. ==== chan-io-49.1 testing crlf reading, leftover cr disgorgment FAILED
  2. ==== Contents of test case:
  3.  
  4. set f [open $path(test1) w]
  5. chan configure $f -translation lf
  6. chan puts -nonewline $f "a\rb\rc\r\n"
  7. chan close $f
  8. set f [open $path(test1) r]
  9. lappend l [file size $path(test1)]
  10. chan configure $f -translation crlf
  11. lappend l [chan read $f 1]
  12. lappend l [chan tell $f]
  13. lappend l [chan read $f 1]
  14. lappend l [chan tell $f]
  15. lappend l [chan read $f 1]
  16. lappend l [chan tell $f]
  17. lappend l [chan read $f 1]
  18. lappend l [chan tell $f]
  19. lappend l [chan read $f 1]
  20. lappend l [chan tell $f]
  21. lappend l [chan read $f 1]
  22. lappend l [chan tell $f]
  23. lappend l [chan eof $f]
  24. lappend l [chan read $f 1]
  25. lappend l [chan eof $f]
  26.  
  27. ---- Result was:
  28. 7 a 1 {
  29. } 2 b 3 {
  30. } 4 c 5 {
  31. } 7 0 {} 1
  32. ---- Result should have been (exact matching):
  33. 7 a 1 {
  34. } 2 b 3
  35. set f1 [open $path(test1) w+]
  36. lappend l [chan configure $f1 -eofchar]
  37. chan configure $f1 -eofchar {ON GO}
  38. lappend l [chan configure $f1 -eofchar]
  39. chan configure $f1 -eofchar D
  40. lappend l [chan configure $f1 -eofchar]
  41. 4 c 5 {
  42. } 7 0 {} 1
  43. ==== chan-io-49.1 FAILED

Comments

Posted by mig at Thu Nov 05 15:14:37 GMT 2015 [text] [code]

The "result was" is perfectly correct, the "should have been" is corrupted. Those wrong lines in the "should have been" are actually the constraints in test chan-io.39.21