rsc.io/quote@v1.5.2/quote_test.go (about)

     1  // Copyright 2018 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 quote
     6  
     7  import (
     8  	"os"
     9  	"testing"
    10  )
    11  
    12  func init() {
    13  	os.Setenv("LC_ALL", "en")
    14  }
    15  
    16  func TestHello(t *testing.T) {
    17  	hello := "Hello, world."
    18  	if out := Hello(); out != hello {
    19  		t.Errorf("Hello() = %q, want %q", out, hello)
    20  	}
    21  }
    22  
    23  func TestGlass(t *testing.T) {
    24  	glass := "I can eat glass and it doesn't hurt me."
    25  	if out := Glass(); out != glass {
    26  		t.Errorf("Glass() = %q, want %q", out, glass)
    27  	}
    28  }
    29  
    30  func TestGo(t *testing.T) {
    31  	go1 := "Don't communicate by sharing memory, share memory by communicating."
    32  	if out := Go(); out != go1 {
    33  		t.Errorf("Go() = %q, want %q", out, go1)
    34  	}
    35  }
    36  
    37  func TestOpt(t *testing.T) {
    38  	opt := "If a program is too slow, it must have a loop."
    39  	if out := Opt(); out != opt {
    40  		t.Errorf("Opt() = %q, want %q", out, opt)
    41  	}
    42  }