This repository has been archived by the owner on Nov 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addressing Sam's comment + adding verbose outcome while running tests…
… using gocheck
- Loading branch information
1 parent
71d27d3
commit f531dd1
Showing
5 changed files
with
78 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package hello_test | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
|
||
. "gopkg.in/check.v1" | ||
) | ||
|
||
// Hook up gocheck into the "go test" runner. | ||
// func Test(t *testing.T) { TestingT(t) } | ||
|
||
type MySuite1 struct{} | ||
|
||
var _ = Suite(&MySuite1{}) | ||
|
||
func (s *MySuite1) SetUpSuite(c *C) { | ||
fmt.Print("hello from mysuite1") | ||
} | ||
|
||
func (s *MySuite1) SetUpTest(c *C) { | ||
fmt.Print("hello from mysuite test ============") | ||
} | ||
|
||
func (s *MySuite1) TestHelloWorld_2(c *C) { | ||
c.Assert(42, Equals, "42") | ||
c.Assert(io.ErrClosedPipe, ErrorMatches, "io: .*on closed pipe") | ||
c.Check(42, Equals, 42) | ||
} | ||
|
||
func (s *MySuite) TestHelloWorld_3(c *C) { | ||
c.Assert(42, Equals, "42") | ||
c.Assert(io.ErrClosedPipe, ErrorMatches, "boom io: .*on closed pipe") | ||
c.Check(42, Equals, 42) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package hello_test | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
"testing" | ||
|
||
. "gopkg.in/check.v1" | ||
) | ||
|
||
// Hook up gocheck into the "go test" runner. | ||
func Test(t *testing.T) { TestingT(t) } | ||
|
||
type MySuite struct{} | ||
|
||
func (s *MySuite) SetUpSuite(c *C) { | ||
fmt.Print("hello from mysuite") | ||
} | ||
|
||
func (s *MySuite) SetUpTest(c *C) { | ||
fmt.Print("hello from mysuite test ============") | ||
} | ||
|
||
var _ = Suite(&MySuite{}) | ||
|
||
func (s *MySuite) TestHelloWorld(c *C) { | ||
c.Assert(42, Equals, "42") | ||
c.Assert(io.ErrClosedPipe, ErrorMatches, "io: .*on closed pipe") | ||
c.Check(42, Equals, 42) | ||
} | ||
|
||
func (s *MySuite) TestHelloWorld_1(c *C) { | ||
c.Assert("42", Equals, "42") | ||
c.Assert(io.ErrClosedPipe, ErrorMatches, "io: .*on closed pipe") | ||
c.Check(42, Equals, 42) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters