import ( "testing" . "gopkg.in/check.v1" ) func TestExampleSuite(t *testing.T) { TestingT(t) } type ExampleSuite struct{} var _ = Suite(&ExampleSuite{}) func (s *ExampleSuite) TestExample(c *C) { c.Assert(true, Equals, true) c.Assert(1+1, Equals, 2) } func (s *ExampleSuite) TestExampleWithSubtests(c *C) { c.Assert(true, Equals, true) c.Assert(1+1, Equals, 2) c.Assert([]byte("hello"), DeepEquals, []byte("hello")) }
import ( "testing" . "gopkg.in/check.v1" ) func TestExampleSuite(t *testing.T) { TestingT(t) } type ExampleSuite struct{} var _ = Suite(&ExampleSuite{}) func (s *ExampleSuite) TestExample1(c *C) { c.Assert(true, Equals, true) } func (s *ExampleSuite) TestExample2(c *C) { c.Assert(1+1, Equals, 2) }This example shows how to define a test suite using go-check. Test suites let you group related tests together and run them all at once. In the example, the `ExampleSuite` struct defines two test cases, `TestExample1` and `TestExample2`. Package library: go-check is the package library for this example.