Sha256: 8c3012769dbc280d69742d1d2d4e12df59fd1e7bee9b259f2a3bc9d3693c0b18

Contents?: true

Size: 654 Bytes

Versions: 28

Compression:

Stored size: 654 Bytes

Contents

package hello

import "testing"

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

const targetTestVersion = 2

func TestHelloWorld(t *testing.T) {
	tests := []struct {
		name, expected string
	}{
		{"", "Hello, World!"},
		{"Gopher", "Hello, Gopher!"},
	}
	for _, test := range tests {
		observed := HelloWorld(test.name)
		if 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

28 entries across 28 versions & 1 rubygems

Version Path
trackler-2.0.3.2 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.3.1 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.3.0 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.2.0 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.1.2 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.1.1 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.1.0 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.10 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.9 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.8 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.7 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.6 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.5 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.4 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.3 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.2 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.1 tracks/go/exercises/hello-world/hello_test.go
trackler-2.0.0.0 tracks/go/exercises/hello-world/hello_test.go
trackler-1.0.4.1 tracks/go/exercises/hello-world/hello_test.go
trackler-1.0.4.0 tracks/go/exercises/hello-world/hello_test.go