-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcases_test.go
44 lines (41 loc) · 858 Bytes
/
cases_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package reverse
// Source: exercism/problem-specifications
// Commit: 6c95c2e reverse-string: Add a test with an even-sized word (#1519)
// Problem Specifications Version: 1.2.0
type reverseTestCase struct {
description string
input string
expected string
}
var testCases = []reverseTestCase{
{
description: "an empty string",
input: "",
expected: "",
},
{
description: "a word",
input: "robot",
expected: "tobor",
},
{
description: "a capitalized word",
input: "Ramen",
expected: "nemaR",
},
{
description: "a sentence with punctuation",
input: "I'm hungry!",
expected: "!yrgnuh m'I",
},
{
description: "a palindrome",
input: "racecar",
expected: "racecar",
},
{
description: "an even-sized word",
input: "drawer",
expected: "reward",
},
}