Sha256: b149ac21cfbf79523ebcaaa68ba29c0b922c1e09f0e5bc8672d75989409d925f

Contents?: true

Size: 1.82 KB

Versions: 42

Compression:

Stored size: 1.82 KB

Contents

package say

// Source: exercism/problem-specifications
// Commit: be403e1 say: Fix canonical-data.json formatting
// Problem Specifications Version: 1.0.0

var testCases = []struct {
	description string
	input       int64
	expected    string
	expectError bool
}{
	{
		description: "zero",
		input:       0,
		expected:    "zero",
	},
	{
		description: "one",
		input:       1,
		expected:    "one",
	},
	{
		description: "fourteen",
		input:       14,
		expected:    "fourteen",
	},
	{
		description: "twenty",
		input:       20,
		expected:    "twenty",
	},
	{
		description: "twenty-two",
		input:       22,
		expected:    "twenty-two",
	},
	{
		description: "one hundred",
		input:       100,
		expected:    "one hundred",
	},
	{
		description: "one hundred twenty-three",
		input:       123,
		expected:    "one hundred twenty-three",
	},
	{
		description: "one thousand",
		input:       1000,
		expected:    "one thousand",
	},
	{
		description: "one thousand two hundred thirty-four",
		input:       1234,
		expected:    "one thousand two hundred thirty-four",
	},
	{
		description: "one million",
		input:       1000000,
		expected:    "one million",
	},
	{
		description: "one million two thousand three hundred forty-five",
		input:       1002345,
		expected:    "one million two thousand three hundred forty-five",
	},
	{
		description: "one billion",
		input:       1000000000,
		expected:    "one billion",
	},
	{
		description: "a big number",
		input:       987654321123,
		expected:    "nine hundred eighty-seven billion six hundred fifty-four million three hundred twenty-one thousand one hundred twenty-three",
	},
	{
		description: "numbers below zero are out of range",
		input:       -1,
		expectError: true,
	},
	{
		description: "numbers above 999,999,999,999 are out of range",
		input:       1000000000000,
		expectError: true,
	},
}

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.97 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.96 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.95 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.94 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.93 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.92 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.91 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.90 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.89 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.88 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.87 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.86 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.85 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.84 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.83 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.82 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.81 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.80 tracks/go/exercises/say/cases_test.go
trackler-2.2.1.79 tracks/go/exercises/say/cases_test.go