Sha256: e9fc27491416ec585474eba05104f2f7a39f95a528d1e29243f7894f9634a82c

Contents?: true

Size: 1.07 KB

Versions: 72

Compression:

Stored size: 1.07 KB

Contents

package grains

// Source: exercism/problem-specifications
// Commit: f079c2d grains: Move input (square) to input object (#1191)
// Problem Specifications Version: 1.1.0

// returns the number of grains on the square
var squareTests = []struct {
	description string
	input       int
	expectedVal uint64
	expectError bool
}{
	{
		description: "1",
		input:       1,
		expectedVal: 1,
	},
	{
		description: "2",
		input:       2,
		expectedVal: 2,
	},
	{
		description: "3",
		input:       3,
		expectedVal: 4,
	},
	{
		description: "4",
		input:       4,
		expectedVal: 8,
	},
	{
		description: "16",
		input:       16,
		expectedVal: 32768,
	},
	{
		description: "32",
		input:       32,
		expectedVal: 2147483648,
	},
	{
		description: "64",
		input:       64,
		expectedVal: 9223372036854775808,
	},
	{
		description: "square 0 returns an error",
		input:       0,
		expectError: true,
	},
	{
		description: "negative square returns an error",
		input:       -1,
		expectError: true,
	},
	{
		description: "square greater than 64 returns an error",
		input:       65,
		expectError: true,
	},
}

Version data entries

72 entries across 72 versions & 1 rubygems

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