libgo: update to Go 1.11
[official-gcc.git] / libgo / go / cmd / go / testdata / mod / rsc.io_quote_v1.1.0.txt
blob0c416053901ce1a4dcfe4198661d91eeaa6a5a47
1 rsc.io/quote@v1.1.0
3 -- .mod --
4 module "rsc.io/quote"
5 -- .info --
6 {"Version":"v1.1.0","Name":"cfd7145f43f92a8d56b4a3dd603795a3291381a9","Short":"cfd7145f43f9","Time":"2018-02-14T00:46:44Z"}
7 -- go.mod --
8 module "rsc.io/quote"
9 -- quote.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.
14 // Package quote collects pithy sayings.
15 package quote // import "rsc.io/quote"
17 // Hello returns a greeting.
18 func Hello() string {
19         return "Hello, world."
22 // Glass returns a useful phrase for world travelers.
23 func Glass() string {
24         // See http://www.oocities.org/nodotus/hbglass.html.
25         return "I can eat glass and it doesn't hurt me."
27 -- quote_test.go --
28 // Copyright 2018 The Go Authors. All rights reserved.
29 // Use of this source code is governed by a BSD-style
30 // license that can be found in the LICENSE file.
32 package quote
34 import "testing"
36 func TestHello(t *testing.T) {
37         hello := "Hello, world."
38         if out := Hello(); out != hello {
39                 t.Errorf("Hello() = %q, want %q", out, hello)
40         }
43 func TestGlass(t *testing.T) {
44         glass := "I can eat glass and it doesn't hurt me."
45         if out := Glass(); out != glass {
46                 t.Errorf("Glass() = %q, want %q", out, glass)
47         }