Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

greet_test.gno

0.33 Kb · 17 lines
 1package greet
 2
 3import "testing"
 4
 5func TestGreet(t *testing.T) {
 6	cases := map[string]string{
 7		"":      "Hello, world!",
 8		"  ":    "Hello, world!",
 9		"moul":  "Hello, moul!",
10		" gno ": "Hello, gno!",
11	}
12	for in, want := range cases {
13		if got := Greet(in); got != want {
14			t.Errorf("Greet(%q) = %q, want %q", in, got, want)
15		}
16	}
17}