gofmt
diff --git a/bootstrap_test.go b/bootstrap_test.go
index e50d9ea..a3bc28c 100644
--- a/bootstrap_test.go
+++ b/bootstrap_test.go
@@ -1,7 +1,7 @@
// These initial tests are for bootstrapping. They verify that we can
// basically use the testing infrastructure itself to check if the test
// system is working.
-//
+//
// These tests use will break down the test runner badly in case of
// errors because if they simply fail, we can't be sure the developer
// will ever see anything (because failing means the failing system
diff --git a/gocheck.go b/gocheck.go
index 90ad97e..780594f 100644
--- a/gocheck.go
+++ b/gocheck.go
@@ -62,7 +62,7 @@
}
func (method *methodType) String() string {
- return method.suiteName()+"."+method.Info.Name
+ return method.suiteName() + "." + method.Info.Name
}
func (method *methodType) matches(re *regexp.Regexp) bool {
@@ -915,4 +915,3 @@
return fmt.Sprintf("%s%s: %s: %s%s", prefix, label, niceFuncPath(pc),
niceFuncName(pc), suffix)
}
-
diff --git a/gocheck_test.go b/gocheck_test.go
index 7575df4..e4acda9 100644
--- a/gocheck_test.go
+++ b/gocheck_test.go
@@ -94,13 +94,13 @@
// Helper suite for testing ordering and behavior of fixture.
type FixtureHelper struct {
- calls []string
- panicOn string
- skip bool
- skipOnN int
- sleepOn string
- sleep time.Duration
- bytes int64
+ calls []string
+ panicOn string
+ skip bool
+ skipOnN int
+ sleepOn string
+ sleep time.Duration
+ bytes int64
}
func (s *FixtureHelper) trace(name string, c *gocheck.C) {
diff --git a/printer_test.go b/printer_test.go
index 547a92d..552bdf7 100644
--- a/printer_test.go
+++ b/printer_test.go
@@ -1,7 +1,7 @@
package gocheck_test
import (
- . "launchpad.net/gocheck"
+ . "launchpad.net/gocheck"
)
var _ = Suite(&PrinterS{})
@@ -9,96 +9,101 @@
type PrinterS struct{}
func (s *PrinterS) TestCountSuite(c *C) {
- suitesRun += 1
+ suitesRun += 1
}
var printTestFuncLine int
func init() {
- printTestFuncLine = getMyLine() + 3
+ printTestFuncLine = getMyLine() + 3
}
func printTestFunc() {
- println(1) // Comment1
- if 2 == 2 { // Comment2
- println(3) // Comment3
- }
- switch 5 {
- case 6: println(6) // Comment6
- println(7)
- }
- switch interface{}(9).(type) {// Comment9
- case int: println(10)
- println(11)
- }
- select {
- case <-(chan bool)(nil): println(14)
- println(15)
- default: println(16)
- println(17)
- }
- println(19,
- 20)
- _ = func() { println(21)
- println(22)
- }
- println(24, func() {
- println(25)
- })
- // Leading comment
- // with multiple lines.
- println(29) // Comment29
+ println(1) // Comment1
+ if 2 == 2 { // Comment2
+ println(3) // Comment3
+ }
+ switch 5 {
+ case 6:
+ println(6) // Comment6
+ println(7)
+ }
+ switch interface{}(9).(type) { // Comment9
+ case int:
+ println(10)
+ println(11)
+ }
+ select {
+ case <-(chan bool)(nil):
+ println(14)
+ println(15)
+ default:
+ println(16)
+ println(17)
+ }
+ println(19,
+ 20)
+ _ = func() {
+ println(21)
+ println(22)
+ }
+ println(24, func() {
+ println(25)
+ })
+ // Leading comment
+ // with multiple lines.
+ println(29) // Comment29
}
var printLineTests = []struct {
- line int
- output string
+ line int
+ output string
}{
- {1, "println(1) // Comment1"},
- {2, "if 2 == 2 { // Comment2\n ...\n}"},
- {3, "println(3) // Comment3"},
- {5, "switch 5 {\n...\n}"},
- {6, "case 6:\n println(6) // Comment6\n ..."},
- {7, "println(7)"},
- {9, "switch interface{}(9).(type) { // Comment9\n...\n}"},
- {10, "case int:\n println(10)\n ..."},
- {14, "case <-(chan bool)(nil):\n println(14)\n ..."},
- {15, "println(15)"},
- {16, "default:\n println(16)\n ..."},
- {17, "println(17)"},
- {19, "println(19,\n 20)"},
- {20, "println(19,\n 20)"},
- {21, "_ = func() {\n println(21)\n println(22)\n}"},
- {22, "println(22)"},
- {24, "println(24, func() {\n println(25)\n})"},
- {25, "println(25)"},
- {26, "println(24, func() {\n println(25)\n})"},
- {29, "// Leading comment\n// with multiple lines.\nprintln(29) // Comment29"},
+ {1, "println(1) // Comment1"},
+ {2, "if 2 == 2 { // Comment2\n ...\n}"},
+ {3, "println(3) // Comment3"},
+ {5, "switch 5 {\n...\n}"},
+ {6, "case 6:\n println(6) // Comment6\n ..."},
+ {7, "println(7)"},
+ {9, "switch interface{}(9).(type) { // Comment9\n...\n}"},
+ {10, "case int:\n println(10)\n ..."},
+ {14, "case <-(chan bool)(nil):\n println(14)\n ..."},
+ {15, "println(15)"},
+ {16, "default:\n println(16)\n ..."},
+ {17, "println(17)"},
+ {19, "println(19,\n 20)"},
+ {20, "println(19,\n 20)"},
+ {21, "_ = func() {\n println(21)\n println(22)\n}"},
+ {22, "println(22)"},
+ {24, "println(24, func() {\n println(25)\n})"},
+ {25, "println(25)"},
+ {26, "println(24, func() {\n println(25)\n})"},
+ {29, "// Leading comment\n// with multiple lines.\nprintln(29) // Comment29"},
}
func (s *PrinterS) TestPrintLine(c *C) {
- for _, test := range printLineTests {
- output, err := PrintLine("printer_test.go", printTestFuncLine+test.line)
- c.Assert(err, IsNil)
- c.Assert(output, Equals, test.output)
- }
+ for _, test := range printLineTests {
+ output, err := PrintLine("printer_test.go", printTestFuncLine+test.line)
+ c.Assert(err, IsNil)
+ c.Assert(output, Equals, test.output)
+ }
}
var indentTests = []struct {
- in, out string
+ in, out string
}{
- {"", ""},
- {"\n", "\n"},
- {"a", ">>>a"},
- {"a\n", ">>>a\n"},
- {"a\nb", ">>>a\n>>>b"},
- {" ", ">>> "},
+ {"", ""},
+ {"\n", "\n"},
+ {"a", ">>>a"},
+ {"a\n", ">>>a\n"},
+ {"a\nb", ">>>a\n>>>b"},
+ {" ", ">>> "},
}
func (s *PrinterS) TestIndent(c *C) {
- for _, test := range indentTests {
- out := Indent(test.in, ">>>")
- c.Assert(out, Equals, test.out)
- }
+ for _, test := range indentTests {
+ out := Indent(test.in, ">>>")
+ c.Assert(out, Equals, test.out)
+ }
}
diff --git a/run.go b/run.go
index 9e08152..8400355 100644
--- a/run.go
+++ b/run.go
@@ -30,7 +30,7 @@
verboseFlag = flag.Bool("gocheck.v", false, "Verbose mode")
streamFlag = flag.Bool("gocheck.vv", false, "Super verbose mode (disables output caching)")
benchFlag = flag.Bool("gocheck.b", false, "Run benchmarks")
- benchTime = flag.Duration("gocheck.btime", 1 * time.Second, "approximate run time for each benchmark")
+ benchTime = flag.Duration("gocheck.btime", 1*time.Second, "approximate run time for each benchmark")
listFlag = flag.Bool("gocheck.list", false, "List the names of all tests that will be run")
)
diff --git a/run_test.go b/run_test.go
index 6793e4c..cdcddc0 100644
--- a/run_test.go
+++ b/run_test.go
@@ -2,7 +2,6 @@
package gocheck_test
-
import (
"errors"
. "launchpad.net/gocheck"
@@ -299,7 +298,7 @@
}
// -----------------------------------------------------------------------
-// Verify that verbose mode prints tests which pass as well.
+// Verify that verbose mode prints tests which pass as well.
func (s *RunS) TestVerboseMode(c *C) {
helper := FixtureHelper{}