6 require "rsc.io/sampler" v1.3.0
8 {"Version":"v1.5.2","Name":"c4d4236f92427c64bfbcf1cc3f8142ab18f30b22","Short":"c4d4236f9242","Time":"2018-02-14T15:44:20Z"}
9 -- buggy/buggy_test.go --
10 // Copyright 2018 The Go Authors. All rights reserved.
11 // Use of this source code is governed by a BSD-style
12 // license that can be found in the LICENSE file.
18 func Test(t *testing.T) {
24 require "rsc.io/sampler" v1.3.0
26 // Copyright 2018 The Go Authors. All rights reserved.
27 // Use of this source code is governed by a BSD-style
28 // license that can be found in the LICENSE file.
30 // Package quote collects pithy sayings.
31 package quote // import "rsc.io/quote"
33 import "rsc.io/sampler"
35 // Hello returns a greeting.
37 return sampler.Hello()
40 // Glass returns a useful phrase for world travelers.
42 // See http://www.oocities.org/nodotus/hbglass.html.
43 return "I can eat glass and it doesn't hurt me."
46 // Go returns a Go proverb.
48 return "Don't communicate by sharing memory, share memory by communicating."
51 // Opt returns an optimization truth.
54 return "If a program is too slow, it must have a loop."
57 // Copyright 2018 The Go Authors. All rights reserved.
58 // Use of this source code is governed by a BSD-style
59 // license that can be found in the LICENSE file.
69 os.Setenv("LC_ALL", "en")
72 func TestHello(t *testing.T) {
73 hello := "Hello, world."
74 if out := Hello(); out != hello {
75 t.Errorf("Hello() = %q, want %q", out, hello)
79 func TestGlass(t *testing.T) {
80 glass := "I can eat glass and it doesn't hurt me."
81 if out := Glass(); out != glass {
82 t.Errorf("Glass() = %q, want %q", out, glass)
86 func TestGo(t *testing.T) {
87 go1 := "Don't communicate by sharing memory, share memory by communicating."
88 if out := Go(); out != go1 {
89 t.Errorf("Go() = %q, want %q", out, go1)
93 func TestOpt(t *testing.T) {
94 opt := "If a program is too slow, it must have a loop."
95 if out := Opt(); out != opt {
96 t.Errorf("Opt() = %q, want %q", out, opt)