...

Text file src/cmd/go/testdata/mod/not-rsc.io_quote_v0.1.0-nomod.txt

Documentation: cmd/go/testdata/mod

     1Constructed by hand.
     2(derived from rsc.io/quote@e7a685a342, but without an explicit go.mod file.)
     3
     4-- .mod --
     5module "not-rsc.io/quote"
     6-- .info --
     7{"Version":"v0.1.0-nomod","Time":"2018-02-14T00:51:33Z"}
     8-- quote.go --
     9// Copyright 2018 The Go Authors. All rights reserved.
    10// Use of this source code is governed by a BSD-style
    11// license that can be found in the LICENSE file.
    12
    13// Package quote collects pithy sayings.
    14package quote // import "rsc.io/quote"
    15
    16// Hello returns a greeting.
    17func Hello() string {
    18	return "Hello, world."
    19}
    20
    21// Glass returns a useful phrase for world travelers.
    22func Glass() string {
    23	// See http://www.oocities.org/nodotus/hbglass.html.
    24	return "I can eat glass and it doesn't hurt me."
    25}
    26
    27// Go returns a Go proverb.
    28func Go() string {
    29	return "Don't communicate by sharing memory, share memory by communicating."
    30}
    31-- quote_test.go --
    32// Copyright 2018 The Go Authors. All rights reserved.
    33// Use of this source code is governed by a BSD-style
    34// license that can be found in the LICENSE file.
    35
    36package quote
    37
    38import "testing"
    39
    40func TestHello(t *testing.T) {
    41	hello := "Hello, world."
    42	if out := Hello(); out != hello {
    43		t.Errorf("Hello() = %q, want %q", out, hello)
    44	}
    45}
    46
    47func TestGlass(t *testing.T) {
    48	glass := "I can eat glass and it doesn't hurt me."
    49	if out := Glass(); out != glass {
    50		t.Errorf("Glass() = %q, want %q", out, glass)
    51	}
    52}
    53
    54func TestGo(t *testing.T) {
    55	go1 := "Don't communicate by sharing memory. Share memory by communicating."
    56	if out := Go(); out != go1 {
    57		t.Errorf("Go() = %q, want %q", out, go1)
    58	}
    59}

View as plain text