Sha256: 3069df1c7e84664961a69610a9d12f133778cbfa492b1b8e13ebe22826e09a0c

Contents?: true

Size: 796 Bytes

Versions: 92

Compression:

Stored size: 796 Bytes

Contents

package collatzconjecture

// Source: exercism/problem-specifications
// Commit: 7bb0a64 collatz-conjecture: Apply new "input" policy
// Problem Specifications Version: 1.2.0

var testCases = []struct {
	description string
	input       int
	expectError bool
	expected    int
}{
	{
		description: "zero steps for one",
		input:       1,
		expected:    0,
	},
	{
		description: "divide if even",
		input:       16,
		expected:    4,
	},
	{
		description: "even and odd steps",
		input:       12,
		expected:    9,
	},
	{
		description: "Large number of even and odd steps",
		input:       1000000,
		expected:    152,
	},
	{
		description: "zero is an error",
		input:       0,
		expectError: true,
	},
	{
		description: "negative value is an error",
		input:       -15,
		expectError: true,
	},
}

Version data entries

92 entries across 92 versions & 1 rubygems

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