"
32 | return // panic?
33 | }
34 |
35 | const maxStackDepth = 100 // This had better be enough...
36 |
37 | var callStack []uintptr = make([]uintptr, maxStackDepth, maxStackDepth)
38 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/nilReporter.go:
--------------------------------------------------------------------------------
1 | package convey
2 |
3 | import (
4 | "github.com/smartystreets/goconvey/convey/reporting"
5 | )
6 |
7 | type nilReporter struct{}
8 |
9 | func (self *nilReporter) BeginStory(story *reporting.StoryReport) {}
10 | func (self *nilReporter) Enter(scope *reporting.ScopeReport) {}
11 | func (self *nilReporter) Report(report *reporting.AssertionResult) {}
12 | func (self *nilReporter) Exit() {}
13 | func (self *nilReporter) EndStory() {}
14 | func (self *nilReporter) Write(p []byte) (int, error) { return len(p), nil }
15 | func newNilReporter() *nilReporter { return &nilReporter{} }
16 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/reporting/console.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import (
4 | "fmt"
5 | "io"
6 | )
7 |
8 | type console struct{}
9 |
10 | func (self *console) Write(p []byte) (n int, err error) {
11 | return fmt.Print(string(p))
12 | }
13 |
14 | func NewConsole() io.Writer {
15 | return new(console)
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/reporting/doc.go:
--------------------------------------------------------------------------------
1 | // Package reporting contains internal functionality related
2 | // to console reporting and output. Although this package has
3 | // exported names is not intended for public consumption. See the
4 | // examples package for how to use this project.
5 | package reporting
6 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/reporting/dot.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import "fmt"
4 |
5 | type dot struct{ out *Printer }
6 |
7 | func (self *dot) BeginStory(story *StoryReport) {}
8 |
9 | func (self *dot) Enter(scope *ScopeReport) {}
10 |
11 | func (self *dot) Report(report *AssertionResult) {
12 | if report.Error != nil {
13 | fmt.Print(redColor)
14 | self.out.Insert(dotError)
15 | } else if report.Failure != "" {
16 | fmt.Print(yellowColor)
17 | self.out.Insert(dotFailure)
18 | } else if report.Skipped {
19 | fmt.Print(yellowColor)
20 | self.out.Insert(dotSkip)
21 | } else {
22 | fmt.Print(greenColor)
23 | self.out.Insert(dotSuccess)
24 | }
25 | fmt.Print(resetColor)
26 | }
27 |
28 | func (self *dot) Exit() {}
29 |
30 | func (self *dot) EndStory() {}
31 |
32 | func (self *dot) Write(content []byte) (written int, err error) {
33 | return len(content), nil // no-op
34 | }
35 |
36 | func NewDotReporter(out *Printer) *dot {
37 | self := new(dot)
38 | self.out = out
39 | return self
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/reporting/dot_test.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import (
4 | "errors"
5 | "testing"
6 | )
7 |
8 | func TestDotReporterAssertionPrinting(t *testing.T) {
9 | monochrome()
10 | file := newMemoryFile()
11 | printer := NewPrinter(file)
12 | reporter := NewDotReporter(printer)
13 |
14 | reporter.Report(NewSuccessReport())
15 | reporter.Report(NewFailureReport("failed"))
16 | reporter.Report(NewErrorReport(errors.New("error")))
17 | reporter.Report(NewSkipReport())
18 |
19 | expected := dotSuccess + dotFailure + dotError + dotSkip
20 |
21 | if file.buffer != expected {
22 | t.Errorf("\nExpected: '%s'\nActual: '%s'", expected, file.buffer)
23 | }
24 | }
25 |
26 | func TestDotReporterOnlyReportsAssertions(t *testing.T) {
27 | monochrome()
28 | file := newMemoryFile()
29 | printer := NewPrinter(file)
30 | reporter := NewDotReporter(printer)
31 |
32 | reporter.BeginStory(nil)
33 | reporter.Enter(nil)
34 | reporter.Exit()
35 | reporter.EndStory()
36 |
37 | if file.buffer != "" {
38 | t.Errorf("\nExpected: '(blank)'\nActual: '%s'", file.buffer)
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/reporting/gotest.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | type gotestReporter struct{ test T }
4 |
5 | func (self *gotestReporter) BeginStory(story *StoryReport) {
6 | self.test = story.Test
7 | }
8 |
9 | func (self *gotestReporter) Enter(scope *ScopeReport) {}
10 |
11 | func (self *gotestReporter) Report(r *AssertionResult) {
12 | if !passed(r) {
13 | self.test.Fail()
14 | }
15 | }
16 |
17 | func (self *gotestReporter) Exit() {}
18 |
19 | func (self *gotestReporter) EndStory() {
20 | self.test = nil
21 | }
22 |
23 | func (self *gotestReporter) Write(content []byte) (written int, err error) {
24 | return len(content), nil // no-op
25 | }
26 |
27 | func NewGoTestReporter() *gotestReporter {
28 | return new(gotestReporter)
29 | }
30 |
31 | func passed(r *AssertionResult) bool {
32 | return r.Error == nil && r.Failure == ""
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/reporting/reporter.go:
--------------------------------------------------------------------------------
1 | package reporting
2 |
3 | import "io"
4 |
5 | type Reporter interface {
6 | BeginStory(story *StoryReport)
7 | Enter(scope *ScopeReport)
8 | Report(r *AssertionResult)
9 | Exit()
10 | EndStory()
11 | io.Writer
12 | }
13 |
14 | type reporters struct{ collection []Reporter }
15 |
16 | func (self *reporters) BeginStory(s *StoryReport) { self.foreach(func(r Reporter) { r.BeginStory(s) }) }
17 | func (self *reporters) Enter(s *ScopeReport) { self.foreach(func(r Reporter) { r.Enter(s) }) }
18 | func (self *reporters) Report(a *AssertionResult) { self.foreach(func(r Reporter) { r.Report(a) }) }
19 | func (self *reporters) Exit() { self.foreach(func(r Reporter) { r.Exit() }) }
20 | func (self *reporters) EndStory() { self.foreach(func(r Reporter) { r.EndStory() }) }
21 |
22 | func (self *reporters) Write(contents []byte) (written int, err error) {
23 | self.foreach(func(r Reporter) {
24 | written, err = r.Write(contents)
25 | })
26 | return written, err
27 | }
28 |
29 | func (self *reporters) foreach(action func(Reporter)) {
30 | for _, r := range self.collection {
31 | action(r)
32 | }
33 | }
34 |
35 | func NewReporters(collection ...Reporter) *reporters {
36 | self := new(reporters)
37 | self.collection = collection
38 | return self
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/convey/reporting/reporting.goconvey:
--------------------------------------------------------------------------------
1 | #ignore
2 | -timeout=1s
3 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/dependencies.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import _ "github.com/jtolds/gls"
4 | import _ "github.com/smartystreets/assertions"
5 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/examples/doc.go:
--------------------------------------------------------------------------------
1 | // Package examples contains, well, examples of how to use goconvey to
2 | // specify behavior of a system under test. It contains a well-known example
3 | // by Robert C. Martin called "Bowling Game Kata" as well as another very
4 | // trivial example that demonstrates Reset() and some of the assertions.
5 | package examples
6 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/examples/examples.goconvey:
--------------------------------------------------------------------------------
1 | // Uncomment the next line to disable the package when running the GoConvey UI:
2 | //IGNORE
3 |
4 | // Uncomment the next line to limit testing to the specified test function name pattern:
5 | //-run=TestAssertionsAreAvailableFromConveyPackage
6 |
7 | // Uncomment the next line to limit testing to those tests that don't bail when testing.Short() is true:
8 | //-short
9 |
10 | // include any additional `go test` flags or application-specific flags below:
11 |
12 | -timeout=1s
13 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/examples/simple_example_test.go:
--------------------------------------------------------------------------------
1 | package examples
2 |
3 | import (
4 | "testing"
5 |
6 | . "github.com/smartystreets/goconvey/convey"
7 | )
8 |
9 | func TestIntegerManipulation(t *testing.T) {
10 | t.Parallel()
11 |
12 | Convey("Given a starting integer value", t, func() {
13 | x := 42
14 |
15 | Convey("When incremented", func() {
16 | x++
17 |
18 | Convey("The value should be greater by one", func() {
19 | So(x, ShouldEqual, 43)
20 | })
21 | Convey("The value should NOT be what it used to be", func() {
22 | So(x, ShouldNotEqual, 42)
23 | })
24 | })
25 | Convey("When decremented", func() {
26 | x--
27 |
28 | Convey("The value should be lesser by one", func() {
29 | So(x, ShouldEqual, 41)
30 | })
31 | Convey("The value should NOT be what it used to be", func() {
32 | So(x, ShouldNotEqual, 42)
33 | })
34 | })
35 | })
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/composer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | GoConvey Composer
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | GoConvey
16 | Composer
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/favicon.ico
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/FontAwesome.otf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/FontAwesome/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Bold.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Italic.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Light.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-LightItalic.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Open_Sans/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Orbitron/Orbitron-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Orbitron/Orbitron-Regular.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Oswald/Oswald-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/fonts/Oswald/Oswald-Regular.ttf
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-buildfail.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-buildfail.ico
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-fail.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-fail.ico
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-ok.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-ok.ico
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-panic.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/github.com/smartystreets/goconvey/web/client/resources/ico/goconvey-panic.ico
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/client/resources/js/config.js:
--------------------------------------------------------------------------------
1 | // Configure the GoConvey web UI client in here
2 |
3 | convey.config = {
4 |
5 | // Install new themes by adding them here; the first one will be default
6 | themes: {
7 | "dark": { name: "Dark", filename: "dark.css", coverage: "hsla({{hue}}, 75%, 30%, .5)" },
8 | "dark-bigtext": { name: "Dark-BigText", filename: "dark-bigtext.css", coverage: "hsla({{hue}}, 75%, 30%, .5)" },
9 | "light": { name: "Light", filename: "light.css", coverage: "hsla({{hue}}, 62%, 75%, 1)" }
10 | },
11 |
12 | // Path to the themes (end with forward-slash)
13 | themePath: "/resources/css/themes/"
14 |
15 | };
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/api/api.goconvey:
--------------------------------------------------------------------------------
1 | #ignore
2 | -timeout=1s
3 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/contract/contracts.go:
--------------------------------------------------------------------------------
1 | package contract
2 |
3 | import "net/http"
4 |
5 | type (
6 | Server interface {
7 | ReceiveUpdate(root string, update *CompleteOutput)
8 | Watch(writer http.ResponseWriter, request *http.Request)
9 | Ignore(writer http.ResponseWriter, request *http.Request)
10 | Reinstate(writer http.ResponseWriter, request *http.Request)
11 | Status(writer http.ResponseWriter, request *http.Request)
12 | LongPollStatus(writer http.ResponseWriter, request *http.Request)
13 | Results(writer http.ResponseWriter, request *http.Request)
14 | Execute(writer http.ResponseWriter, request *http.Request)
15 | TogglePause(writer http.ResponseWriter, request *http.Request)
16 | }
17 |
18 | Executor interface {
19 | ExecuteTests([]*Package) *CompleteOutput
20 | Status() string
21 | ClearStatusFlag() bool
22 | }
23 |
24 | Shell interface {
25 | GoTest(directory, packageName string, tags, arguments []string) (output string, err error)
26 | }
27 | )
28 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/executor/contract.go:
--------------------------------------------------------------------------------
1 | package executor
2 |
3 | import "github.com/smartystreets/goconvey/web/server/contract"
4 |
5 | type Parser interface {
6 | Parse([]*contract.Package)
7 | }
8 |
9 | type Tester interface {
10 | SetBatchSize(batchSize int)
11 | TestAll(folders []*contract.Package)
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/executor/executor.goconvey:
--------------------------------------------------------------------------------
1 | #ignore
2 | -timeout=1s
3 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/messaging/messages.go:
--------------------------------------------------------------------------------
1 | package messaging
2 |
3 | ///////////////////////////////////////////////////////////////////////////////
4 |
5 | type WatcherCommand struct {
6 | Instruction WatcherInstruction
7 | Details string
8 | }
9 |
10 | type WatcherInstruction int
11 |
12 | func (this WatcherInstruction) String() string {
13 | switch this {
14 | case WatcherPause:
15 | return "Pause"
16 | case WatcherResume:
17 | return "Resume"
18 | case WatcherIgnore:
19 | return "Ignore"
20 | case WatcherReinstate:
21 | return "Reinstate"
22 | case WatcherAdjustRoot:
23 | return "AdjustRoot"
24 | case WatcherExecute:
25 | return "Execute"
26 | case WatcherStop:
27 | return "Stop"
28 | default:
29 | return "UNKNOWN INSTRUCTION"
30 | }
31 | }
32 |
33 | const (
34 | WatcherPause WatcherInstruction = iota
35 | WatcherResume
36 | WatcherIgnore
37 | WatcherReinstate
38 | WatcherAdjustRoot
39 | WatcherExecute
40 | WatcherStop
41 | )
42 |
43 | ///////////////////////////////////////////////////////////////////////////////
44 |
45 | type Folders map[string]*Folder
46 |
47 | type Folder struct {
48 | Path string // key
49 | Root string
50 | Ignored bool
51 | Disabled bool
52 | BuildTags []string
53 | TestArguments []string
54 | }
55 |
56 | ///////////////////////////////////////////////////////////////////////////////
57 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/parser/parser.go:
--------------------------------------------------------------------------------
1 | package parser
2 |
3 | import (
4 | "log"
5 |
6 | "github.com/smartystreets/goconvey/web/server/contract"
7 | )
8 |
9 | type Parser struct {
10 | parser func(*contract.PackageResult, string)
11 | }
12 |
13 | func (self *Parser) Parse(packages []*contract.Package) {
14 | for _, p := range packages {
15 | if p.Active() && p.HasUsableResult() {
16 | self.parser(p.Result, p.Output)
17 | } else if p.Ignored {
18 | p.Result.Outcome = contract.Ignored
19 | } else if p.Disabled {
20 | p.Result.Outcome = contract.Disabled
21 | } else {
22 | p.Result.Outcome = contract.TestRunAbortedUnexpectedly
23 | }
24 | log.Printf("[%s]: %s\n", p.Result.Outcome, p.Name)
25 | }
26 | }
27 |
28 | func NewParser(helper func(*contract.PackageResult, string)) *Parser {
29 | self := new(Parser)
30 | self.parser = helper
31 | return self
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/parser/parser.goconvey:
--------------------------------------------------------------------------------
1 | #ignore
2 | -timeout=1s
3 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/parser/util.go:
--------------------------------------------------------------------------------
1 | package parser
2 |
3 | import (
4 | "math"
5 | "strings"
6 | "time"
7 | )
8 |
9 | // parseTestFunctionDuration parses the duration in seconds as a float64
10 | // from a line of go test output that looks something like this:
11 | // --- PASS: TestOldSchool_PassesWithMessage (0.03 seconds)
12 | func parseTestFunctionDuration(line string) float64 {
13 | line = strings.Replace(line, "(", "", 1)
14 | fields := strings.Split(line, " ")
15 | return parseDurationInSeconds(fields[3]+"s", 2)
16 | }
17 |
18 | func parseDurationInSeconds(raw string, precision int) float64 {
19 | elapsed, _ := time.ParseDuration(raw)
20 | return round(elapsed.Seconds(), precision)
21 | }
22 |
23 | // round returns the rounded version of x with precision.
24 | //
25 | // Special cases are:
26 | // round(±0) = ±0
27 | // round(±Inf) = ±Inf
28 | // round(NaN) = NaN
29 | //
30 | // Why, oh why doesn't the math package come with a round function?
31 | // Inspiration: http://play.golang.org/p/ZmFfr07oHp
32 | func round(x float64, precision int) float64 {
33 | var rounder float64
34 | pow := math.Pow(10, float64(precision))
35 | intermediate := x * pow
36 |
37 | if intermediate < 0.0 {
38 | intermediate -= 0.5
39 | } else {
40 | intermediate += 0.5
41 | }
42 | rounder = float64(int64(intermediate))
43 |
44 | return rounder / float64(pow)
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/system/shell_integration_test.go:
--------------------------------------------------------------------------------
1 | package system
2 |
3 | import (
4 | "log"
5 | "path/filepath"
6 | "runtime"
7 | "strings"
8 |
9 | "testing"
10 | )
11 |
12 | func TestShellIntegration(t *testing.T) {
13 | if testing.Short() {
14 | t.Skip("Skipping potentially long-running integration test...")
15 | return
16 | }
17 |
18 | log.SetFlags(log.LstdFlags | log.Lshortfile | log.Lmicroseconds)
19 |
20 | _, filename, _, _ := runtime.Caller(0)
21 | directory := filepath.Join(filepath.Dir(filename), "..", "watch", "integration_testing", "sub")
22 | packageName := "github.com/smartystreets/goconvey/web/server/watch/integration_testing/sub"
23 |
24 | shell := NewShell("go", "", true, "5s")
25 | output, err := shell.GoTest(directory, packageName, []string{}, []string{"-short"})
26 |
27 | if !strings.Contains(output, "PASS\n") || !strings.Contains(output, "ok") {
28 | t.Errorf("Expected output that resembed tests passing but got this instead: [%s]", output)
29 | }
30 | if err != nil {
31 | t.Error("Test run resulted in the following error:", err)
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/system/system.goconvey:
--------------------------------------------------------------------------------
1 | #ignore
2 | -timeout=1s
3 | -short
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/watch/integration_testing/main.go:
--------------------------------------------------------------------------------
1 | // This file's only purpose is to provide a realistic
2 | // environment from which to run integration tests
3 | // against the Watcher.
4 | package main
5 |
6 | import "fmt"
7 |
8 | func main() {
9 | fmt.Println("Hello, World!")
10 | }
11 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/watch/integration_testing/sub/.gitignore:
--------------------------------------------------------------------------------
1 | github.com-smartystreets-goconvey-web-server-integration_testing-sub.html
2 | github.com-smartystreets-goconvey-web-server-integration_testing-sub.txt
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/watch/integration_testing/sub/stuff.go:
--------------------------------------------------------------------------------
1 | // This file's only purpose is to provide a realistic
2 | // environment from which to run integration tests
3 | // against the Watcher.
4 | package sub
5 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/watch/integration_testing/sub/stuff_test.go:
--------------------------------------------------------------------------------
1 | // This file's only purpose is to provide a realistic
2 | // environment from which to run integration tests
3 | // against the Watcher.
4 | package sub
5 |
6 | import (
7 | "fmt"
8 | "testing"
9 | )
10 |
11 | func TestStuff(t *testing.T) {
12 | if testing.Short() {
13 | return
14 | }
15 |
16 | fmt.Println()
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/watch/integration_testing/sub/sub.goconvey:
--------------------------------------------------------------------------------
1 | IGNORE
2 | -short
3 | -run=TestStuff
4 |
5 | // This file's only purpose is to provide a realistic
6 | // environment from which to run integration tests
7 | // against the Watcher.
8 |
--------------------------------------------------------------------------------
/vendor/src/github.com/smartystreets/goconvey/web/server/watch/watch.goconvey:
--------------------------------------------------------------------------------
1 | #ignore
2 | -timeout=1s
3 | -short
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/.gitattributes:
--------------------------------------------------------------------------------
1 | # Treat all files in this repo as binary, with no git magic updating
2 | # line endings. Windows users contributing to Go will need to use a
3 | # modern version of git and editors capable of LF line endings.
4 | #
5 | # We'll prevent accidental CRLF line endings from entering the repo
6 | # via the git-review gofmt checks.
7 | #
8 | # See golang.org/issue/9281
9 |
10 | * -text
11 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/.gitignore:
--------------------------------------------------------------------------------
1 | # Add no patterns to .hgignore except for files generated by the build.
2 | last-change
3 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Go
2 |
3 | Go is an open source project.
4 |
5 | It is the work of hundreds of contributors. We appreciate your help!
6 |
7 |
8 | ## Filing issues
9 |
10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:
11 |
12 | 1. What version of Go are you using (`go version`)?
13 | 2. What operating system and processor architecture are you using?
14 | 3. What did you do?
15 | 4. What did you expect to see?
16 | 5. What did you see instead?
17 |
18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.
19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug.
20 |
21 | ## Contributing code
22 |
23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
24 | before sending patches.
25 |
26 | **We do not accept GitHub pull requests**
27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review).
28 |
29 | Unless otherwise noted, the Go source files are distributed under
30 | the BSD-style license found in the LICENSE file.
31 |
32 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/README:
--------------------------------------------------------------------------------
1 | This repository holds supplementary Go networking libraries.
2 |
3 | To submit changes to this repository, see http://golang.org/doc/contribute.html.
4 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/codereview.cfg:
--------------------------------------------------------------------------------
1 | issuerepo: golang/go
2 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/context/withtimeout_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package context_test
6 |
7 | import (
8 | "fmt"
9 | "time"
10 |
11 | "golang.org/x/net/context"
12 | )
13 |
14 | func ExampleWithTimeout() {
15 | // Pass a context with a timeout to tell a blocking function that it
16 | // should abandon its work after the timeout elapses.
17 | ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)
18 | select {
19 | case <-time.After(200 * time.Millisecond):
20 | fmt.Println("overslept")
21 | case <-ctx.Done():
22 | fmt.Println(ctx.Err()) // prints "context deadline exceeded"
23 | }
24 | // Output:
25 | // context deadline exceeded
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/html/charset/testdata/README:
--------------------------------------------------------------------------------
1 | These test cases come from
2 | http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics
3 |
4 | Distributed under both the W3C Test Suite License
5 | (http://www.w3.org/Consortium/Legal/2008/04-testsuite-license)
6 | and the W3C 3-clause BSD License
7 | (http://www.w3.org/Consortium/Legal/2008/03-bsd-license).
8 | To contribute to a W3C Test Suite, see the policies and contribution
9 | forms (http://www.w3.org/2004/10/27-testcases).
10 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mongodb-labs/mongoproxy/60648291da5026a12328b67578f0400e17eee62c/vendor/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/html/entity_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package html
6 |
7 | import (
8 | "testing"
9 | "unicode/utf8"
10 | )
11 |
12 | func TestEntityLength(t *testing.T) {
13 | // We verify that the length of UTF-8 encoding of each value is <= 1 + len(key).
14 | // The +1 comes from the leading "&". This property implies that the length of
15 | // unescaped text is <= the length of escaped text.
16 | for k, v := range entity {
17 | if 1+len(k) < utf8.RuneLen(v) {
18 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v))
19 | }
20 | if len(k) > longestEntityWithoutSemicolon && k[len(k)-1] != ';' {
21 | t.Errorf("entity name %s is %d characters, but longestEntityWithoutSemicolon=%d", k, len(k), longestEntityWithoutSemicolon)
22 | }
23 | }
24 | for k, v := range entity2 {
25 | if 1+len(k) < utf8.RuneLen(v[0])+utf8.RuneLen(v[1]) {
26 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v[0]) + string(v[1]))
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/html/example_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // This example demonstrates parsing HTML data and walking the resulting tree.
6 | package html_test
7 |
8 | import (
9 | "fmt"
10 | "log"
11 | "strings"
12 |
13 | "golang.org/x/net/html"
14 | )
15 |
16 | func ExampleParse() {
17 | s := `Links:
`
18 | doc, err := html.Parse(strings.NewReader(s))
19 | if err != nil {
20 | log.Fatal(err)
21 | }
22 | var f func(*html.Node)
23 | f = func(n *html.Node) {
24 | if n.Type == html.ElementNode && n.Data == "a" {
25 | for _, a := range n.Attr {
26 | if a.Key == "href" {
27 | fmt.Println(a.Val)
28 | break
29 | }
30 | }
31 | }
32 | for c := n.FirstChild; c != nil; c = c.NextSibling {
33 | f(c)
34 | }
35 | }
36 | f(doc)
37 | // Output:
38 | // foo
39 | // /bar/baz
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/src/golang.org/x/net/html/testdata/webkit/adoption02.dat:
--------------------------------------------------------------------------------
1 | #data
2 | 1234
3 | #errors
4 | #document
5 | |
6 | |
7 | |
8 | |
9 | | "1"
10 | |
11 | | "2"
12 | |
13 | |
14 | |
15 | | "3"
16 | | "4"
17 |
18 | #data
19 |