|
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(c, "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: \n"+ |
| 49 | + " c.Check(42, Equals, 43)\n"+ |
| 50 | + " ... obtained int = 42\n"+ |
| 51 | + " ... expected int = 43\n") |
| 52 | + |
| 53 | + c.Check(output.Status("integrationTestHelper/TestMultiLineStringEqualFails"), Equals, "fail") |
| 54 | + c.Check(output.Logs("integrationTestHelper/TestMultiLineStringEqualFails"), Equals, ""+ |
| 55 | + " integration_test.go:19: \n"+ |
| 56 | + " c.Check(\"foo\\nbar\\nbaz\\nboom\\n\", Equals, \"foo\\nbaar\\nbaz\\nboom\\n\")\n"+ |
| 57 | + " ... obtained string = \"\" +\n"+ |
| 58 | + " ... \"foo\\n\" +\n"+ |
| 59 | + " ... \"bar\\n\" +\n"+ |
| 60 | + " ... \"baz\\n\" +\n"+ |
| 61 | + " ... \"boom\\n\"\n"+ |
| 62 | + " ... expected string = \"\" +\n"+ |
| 63 | + " ... \"foo\\n\" +\n"+ |
| 64 | + " ... \"baar\\n\" +\n"+ |
| 65 | + " ... \"baz\\n\" +\n"+ |
| 66 | + " ... \"boom\\n\"\n"+ |
| 67 | + " ... String difference:\n"+ |
| 68 | + " ... [1]: \"bar\" != \"baar\"\n") |
| 69 | + |
| 70 | + c.Check(output.Status("integrationTestHelper/TestStringEqualFails"), Equals, "fail") |
| 71 | + c.Check(output.Logs("integrationTestHelper/TestStringEqualFails"), Equals, ""+ |
| 72 | + " integration_test.go:23: \n"+ |
| 73 | + " c.Check(\"foo\", Equals, \"bar\")\n"+ |
| 74 | + " ... obtained string = \"foo\"\n"+ |
| 75 | + " ... expected string = \"bar\"\n") |
| 76 | + |
| 77 | + c.Check(output.Status("integrationTestHelper/TestStructEqualFails"), Equals, "fail") |
| 78 | + c.Check(output.Logs("integrationTestHelper/TestStructEqualFails"), Equals, ""+ |
| 79 | + " integration_test.go:35: \n"+ |
| 80 | + " c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4})\n"+ |
| 81 | + " ... obtained check_test.complexStruct = check_test.complexStruct{r:1, i:2}\n"+ |
| 82 | + " ... expected check_test.complexStruct = check_test.complexStruct{r:3, i:4}\n"+ |
| 83 | + " ... Difference:\n"+ |
| 84 | + " ... r: 1 != 3\n"+ |
| 85 | + " ... i: 2 != 4\n") |
96 | 86 | } |
0 commit comments