Sha256: 465cc0648f5bfd61ba481d94c0f45ff5293c33835b2ff21558d1bf9b9c6259ab

Contents?: true

Size: 533 Bytes

Versions: 122

Compression:

Stored size: 533 Bytes

Contents

package secret

import (
	"reflect"
	"testing"
)

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++ {
		for j := uint(0); j < 32; j++ {
			Handshake(j)
		}
	}
}

Version data entries

122 entries across 122 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.179 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.178 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.177 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.176 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.175 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.174 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.173 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.172 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.171 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.170 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.169 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.167 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.166 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.165 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.164 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.163 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.162 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.161 tracks/go/exercises/secret-handshake/secret_handshake_test.go
trackler-2.2.1.160 tracks/go/exercises/secret-handshake/secret_handshake_test.go