LEFT | RIGHT |
(no file at all) | |
1 // skip | 1 // skip |
2 | 2 |
3 // Copyright 2012 The Go Authors. All rights reserved. | 3 // Copyright 2012 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
6 | 6 |
7 // Run runs tests in the test directory. | 7 // Run runs tests in the test directory. |
8 //· | 8 //· |
9 // TODO(bradfitz): docs of some sort, once we figure out how we're changing | 9 // TODO(bradfitz): docs of some sort, once we figure out how we're changing |
10 // headers of files | 10 // headers of files |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 if err != nil { | 337 if err != nil { |
338 t.err = fmt.Errorf("%s\n%s", err, out) | 338 t.err = fmt.Errorf("%s\n%s", err, out) |
339 } | 339 } |
340 | 340 |
341 case "run": | 341 case "run": |
342 useTmp = false | 342 useTmp = false |
343 out, err := runcmd(append([]string{"go", "run", t.goFileName()},
args...)...) | 343 out, err := runcmd(append([]string{"go", "run", t.goFileName()},
args...)...) |
344 if err != nil { | 344 if err != nil { |
345 t.err = fmt.Errorf("%s\n%s", err, out) | 345 t.err = fmt.Errorf("%s\n%s", err, out) |
346 } | 346 } |
347 » » if string(out) != t.expectedOutput() { | 347 » » if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedO
utput() { |
348 t.err = fmt.Errorf("incorrect output\n%s", out) | 348 t.err = fmt.Errorf("incorrect output\n%s", out) |
349 } | 349 } |
350 | 350 |
351 case "runoutput": | 351 case "runoutput": |
352 useTmp = false | 352 useTmp = false |
353 out, err := runcmd("go", "run", t.goFileName()) | 353 out, err := runcmd("go", "run", t.goFileName()) |
354 if err != nil { | 354 if err != nil { |
355 t.err = fmt.Errorf("%s\n%s", err, out) | 355 t.err = fmt.Errorf("%s\n%s", err, out) |
356 } | 356 } |
357 tfile := filepath.Join(t.tempDir, "tmp__.go") | 357 tfile := filepath.Join(t.tempDir, "tmp__.go") |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 re: regexp.MustCompile(rx), | 510 re: regexp.MustCompile(rx), |
511 filterRe: regexp.MustCompile(filterPattern), | 511 filterRe: regexp.MustCompile(filterPattern), |
512 lineNum: lineNum, | 512 lineNum: lineNum, |
513 file: t.gofile, | 513 file: t.gofile, |
514 }) | 514 }) |
515 } | 515 } |
516 } | 516 } |
517 | 517 |
518 return | 518 return |
519 } | 519 } |
LEFT | RIGHT |