libgo: update to Go 1.11
[official-gcc.git] / libgo / go / cmd / go / testdata / mod / rsc.io_!q!u!o!t!e_v1.5.2.txt
blob21185c39f3320ed7e5b5926cf18d48bd3a923fdc
1 rsc.io/QUOTE v1.5.2
3 -- .mod --
4 module rsc.io/QUOTE
6 require rsc.io/quote v1.5.2
7 -- .info --
8 {"Version":"v1.5.2","Name":"","Short":"","Time":"2018-07-15T16:25:34Z"}
9 -- go.mod --
10 module rsc.io/QUOTE
12 require rsc.io/quote v1.5.2
13 -- QUOTE/quote.go --
14 // Copyright 2018 The Go Authors. All rights reserved.
15 // Use of this source code is governed by a BSD-style
16 // license that can be found in the LICENSE file.
18 // PACKAGE QUOTE COLLECTS LOUD SAYINGS.
19 package QUOTE
21 import (
22         "strings"
24         "rsc.io/quote"
27 // HELLO RETURNS A GREETING.
28 func HELLO() string {
29         return strings.ToUpper(quote.Hello())
32 // GLASS RETURNS A USEFUL PHRASE FOR WORLD TRAVELERS.
33 func GLASS() string {
34         return strings.ToUpper(quote.GLASS())
37 // GO RETURNS A GO PROVERB.
38 func GO() string {
39         return strings.ToUpper(quote.GO())
42 // OPT RETURNS AN OPTIMIZATION TRUTH.
43 func OPT() string {
44         return strings.ToUpper(quote.OPT())
46 -- QUOTE/quote_test.go --
47 // Copyright 2018 The Go Authors. All rights reserved.
48 // Use of this source code is governed by a BSD-style
49 // license that can be found in the LICENSE file.
51 package QUOTE
53 import (
54         "os"
55         "testing"
58 func init() {
59         os.Setenv("LC_ALL", "en")
62 func TestHELLO(t *testing.T) {
63         hello := "HELLO, WORLD"
64         if out := HELLO(); out != hello {
65                 t.Errorf("HELLO() = %q, want %q", out, hello)
66         }
69 func TestGLASS(t *testing.T) {
70         glass := "I CAN EAT GLASS AND IT DOESN'T HURT ME."
71         if out := GLASS(); out != glass {
72                 t.Errorf("GLASS() = %q, want %q", out, glass)
73         }
76 func TestGO(t *testing.T) {
77         go1 := "DON'T COMMUNICATE BY SHARING MEMORY, SHARE MEMORY BY COMMUNICATING."
78         if out := GO(); out != go1 {
79                 t.Errorf("GO() = %q, want %q", out, go1)
80         }
83 func TestOPT(t *testing.T) {
84         opt := "IF A PROGRAM IS TOO SLOW, IT MUST HAVE A LOOP."
85         if out := OPT(); out != opt {
86                 t.Errorf("OPT() = %q, want %q", out, opt)
87         }