summaryrefslogtreecommitdiff
path: root/test/run.go
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-09-20 00:27:23 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-09-20 00:27:23 +0800
commitc9670a0ca0c1dc8acb594303ede72bcd3feae9ef (patch)
tree426cff761ab107d569c03c905096d486fd7c55d3 /test/run.go
parent713a157a62a043f6a732ad7ad9cd3b6b2358e526 (diff)
downloadgo-c9670a0ca0c1dc8acb594303ede72bcd3feae9ef.tar.gz
misc/cgo/stdio: make it work on Windows and also test it
use a function to get stdout and stderr, instead of depending on a specific libc implementation. also make test/run.go replace \r\n by \n before comparing output. Fixes issue 2121. Part of issue 1741. R=alex.brainman, rsc, r, remyoudompheng CC=golang-dev http://codereview.appspot.com/5847068
Diffstat (limited to 'test/run.go')
-rw-r--r--test/run.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/run.go b/test/run.go
index b23860692..c82c138be 100644
--- a/test/run.go
+++ b/test/run.go
@@ -344,7 +344,7 @@ func (t *test) run() {
if err != nil {
t.err = fmt.Errorf("%s\n%s", err, out)
}
- if string(out) != t.expectedOutput() {
+ if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() {
t.err = fmt.Errorf("incorrect output\n%s", out)
}