Sha256: d2be581e92f610a98dae7008d393dcf73b8fd2a0a00dddfdb23d3a2711e1f0a0

Contents?: true

Size: 706 Bytes

Versions: 68

Compression:

Stored size: 706 Bytes

Contents

package greeting

import "testing"

// Define a function HelloWorld(string) string.
//
// Also define a testVersion with a value that matches
// the targetTestVersion here.

const targetTestVersion = 3

func TestHelloWorld(t *testing.T) {
	tests := []struct {
		name, expected string
	}{
		{"", "Hello, World!"},
		{"Gopher", "Hello, Gopher!"},
		{"ゴーファー", "Hello, ゴーファー!"},
	}
	for _, test := range tests {
		if observed := HelloWorld(test.name); observed != test.expected {
			t.Fatalf("HelloWorld(%s) = %v, want %v", test.name, observed, test.expected)
		}
	}

	if testVersion != targetTestVersion {
		t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
	}
}

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.0.6.40 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.39 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.38 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.37 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.36 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.35 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.34 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.33 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.32 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.31 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.30 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.29 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.28 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.27 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.26 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.25 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.24 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.23 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.22 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.6.21 tracks/go/exercises/hello-world/hello_test.go