Sha256: 27b8dd06dbbb4bcdfa99561d1a0bafe1fdb4be232bf665572bb83f8d54f43fad

Contents?: true

Size: 684 Bytes

Versions: 59

Compression:

Stored size: 684 Bytes

Contents

package secret

import (
	"reflect"
	"testing"
)

const targetTestVersion = 2

func TestTestVersion(t *testing.T) {
	if testVersion != targetTestVersion {
		t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
	}
}

func TestHandshake(t *testing.T) {
	for _, test := range tests {
		h := Handshake(test.code)
		// use len() to allow either nil or empty list, because
		// they are not equal by DeepEqual
		if len(h) == 0 && len(test.h) == 0 {
			continue
		}
		if !reflect.DeepEqual(h, test.h) {
			t.Fatalf("Handshake(%d) = %q, want %q.", test.code, h, test.h)
		}
	}
}

func BenchmarkHandshake(b *testing.B) {
	for i := 0; i < b.N; i++ {
		Handshake(31)
	}
}

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
trackler-2.2.1.24 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.23 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.22 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.21 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.20 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.19 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.18 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.17 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.16 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.15 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.14 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.13 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.12 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.11 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.10 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.9 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.8 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.7 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.6 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.5 tracks/go/exercises/secret-handshake/secret_handshake_test.go