blob: 1e673619c7b6352caf15d8ec737f6b7ade7f9aa6 [file] [log] [blame]
// +build ignore,OMIT
package main
import "strings"
import "testing"
func TestToUpper(t *testing.T) {
in := "loud noises"
want := "LOUD NOISES"
got := strings.ToUpper(in)
if got != want {
t.Errorf("ToUpper(%v) = %v, want %v", in, got, want)
}
}
func TestContains(t *testing.T) {
var tests = []struct {
str, substr string
expected bool
}{
{"abc", "bc", true},
{"abc", "bcd", false},
{"abc", "", true},
{"", "a", false},
}
for _, ct := range tests {
if strings.Contains(ct.str, ct.substr) != ct.expected {
t.Errorf("Contains(%s, %s) = %v, want %v",
ct.str, ct.substr, !ct.expected, ct.expected)
}
}
}