|
1 |
| -//+build nowhere |
2 |
| - |
3 | 1 | // Integration tests
|
4 | 2 |
|
5 | 3 | package check_test
|
@@ -37,60 +35,52 @@ func (s *integrationTestHelper) TestStructEqualFails(c *C) {
|
37 | 35 | c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4})
|
38 | 36 | }
|
39 | 37 |
|
40 |
| -func (s *integrationS) TestOutput(c *C) { |
41 |
| - helper := integrationTestHelper{} |
42 |
| - output := String{} |
43 |
| - Run(&helper, &RunConf{Output: &output}) |
44 |
| - c.Assert(output.value, Equals, ` |
45 |
| ----------------------------------------------------------------------- |
46 |
| -FAIL: integration_test.go:26: integrationTestHelper.TestIntEqualFails |
47 |
| -
|
48 |
| -integration_test.go:27: |
49 |
| - c.Check(42, Equals, 43) |
50 |
| -... obtained int = 42 |
51 |
| -... expected int = 43 |
52 |
| -
|
53 |
| -
|
54 |
| ----------------------------------------------------------------------- |
55 |
| -FAIL: integration_test.go:18: integrationTestHelper.TestMultiLineStringEqualFails |
56 |
| -
|
57 |
| -integration_test.go:19: |
58 |
| - c.Check("foo\nbar\nbaz\nboom\n", Equals, "foo\nbaar\nbaz\nboom\n") |
59 |
| -... obtained string = "" + |
60 |
| -... "foo\n" + |
61 |
| -... "bar\n" + |
62 |
| -... "baz\n" + |
63 |
| -... "boom\n" |
64 |
| -... expected string = "" + |
65 |
| -... "foo\n" + |
66 |
| -... "baar\n" + |
67 |
| -... "baz\n" + |
68 |
| -... "boom\n" |
69 |
| -... String difference: |
70 |
| -... [1]: "bar" != "baar" |
71 |
| -
|
72 |
| -
|
73 |
| -
|
74 |
| ----------------------------------------------------------------------- |
75 |
| -FAIL: integration_test.go:22: integrationTestHelper.TestStringEqualFails |
76 |
| -
|
77 |
| -integration_test.go:23: |
78 |
| - c.Check("foo", Equals, "bar") |
79 |
| -... obtained string = "foo" |
80 |
| -... expected string = "bar" |
81 |
| -
|
82 |
| -
|
83 |
| ----------------------------------------------------------------------- |
84 |
| -FAIL: integration_test.go:34: integrationTestHelper.TestStructEqualFails |
85 |
| -
|
86 |
| -integration_test.go:35: |
87 |
| - c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4}) |
88 |
| -... obtained check_test.complexStruct = check_test.complexStruct{r:1, i:2} |
89 |
| -... expected check_test.complexStruct = check_test.complexStruct{r:3, i:4} |
90 |
| -... Difference: |
91 |
| -... r: 1 != 3 |
92 |
| -... i: 2 != 4 |
93 |
| -
|
| 38 | +func (s *integrationS) TestCountSuite(c *C) { |
| 39 | + suitesRun += 1 |
| 40 | +} |
94 | 41 |
|
95 |
| -`) |
| 42 | +func (s *integrationS) TestOutput(c *C) { |
| 43 | + exitCode, output := runHelperSuite("integrationTestHelper") |
| 44 | + c.Check(exitCode, Equals, 1) |
| 45 | + |
| 46 | + c.Check(output.Status("integrationTestHelper/TestIntEqualFails"), Equals, "FAIL") |
| 47 | + c.Check(output.Logs("integrationTestHelper/TestIntEqualFails"), Equals, |
| 48 | + ` integration_test.go:27: |
| 49 | + c.Check(42, Equals, 43) |
| 50 | + ... obtained int = 42 |
| 51 | + ... expected int = 43`) |
| 52 | + |
| 53 | + c.Check(output.Status("integrationTestHelper/TestMultiLineStringEqualFails"), Equals, "FAIL") |
| 54 | + c.Check(output.Logs("integrationTestHelper/TestMultiLineStringEqualFails"), Equals, |
| 55 | + ` integration_test.go:19: |
| 56 | + c.Check("foo\nbar\nbaz\nboom\n", Equals, "foo\nbaar\nbaz\nboom\n") |
| 57 | + ... obtained string = "" + |
| 58 | + ... "foo\n" + |
| 59 | + ... "bar\n" + |
| 60 | + ... "baz\n" + |
| 61 | + ... "boom\n" |
| 62 | + ... expected string = "" + |
| 63 | + ... "foo\n" + |
| 64 | + ... "baar\n" + |
| 65 | + ... "baz\n" + |
| 66 | + ... "boom\n" |
| 67 | + ... String difference: |
| 68 | + ... [1]: "bar" != "baar"`) |
| 69 | + |
| 70 | + c.Check(output.Status("integrationTestHelper/TestStringEqualFails"), Equals, "FAIL") |
| 71 | + c.Check(output.Logs("integrationTestHelper/TestStringEqualFails"), Equals, |
| 72 | + ` integration_test.go:23: |
| 73 | + c.Check("foo", Equals, "bar") |
| 74 | + ... obtained string = "foo" |
| 75 | + ... expected string = "bar"`) |
| 76 | + |
| 77 | + c.Check(output.Status("integrationTestHelper/TestStructEqualFails"), Equals, "FAIL") |
| 78 | + c.Check(output.Logs("integrationTestHelper/TestStructEqualFails"), Equals, |
| 79 | + ` integration_test.go:35: |
| 80 | + c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4}) |
| 81 | + ... obtained check_test.complexStruct = check_test.complexStruct{r:1, i:2} |
| 82 | + ... expected check_test.complexStruct = check_test.complexStruct{r:3, i:4} |
| 83 | + ... Difference: |
| 84 | + ... r: 1 != 3 |
| 85 | + ... i: 2 != 4`) |
96 | 86 | }
|
0 commit comments