summaryrefslogtreecommitdiff
path: root/go/reverse-string/cases_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-09-22 15:26:42 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-09-22 15:26:42 +0200
commit1c0526fd0df159c46c9b5117704894ec49158cd0 (patch)
treea711a2c2a1540e90cb747d90627642f646469bd5 /go/reverse-string/cases_test.go
parentdea0ce8b414f72b60d3b7d0a9c8ac72296e8705d (diff)
solve reverse string
Diffstat (limited to 'go/reverse-string/cases_test.go')
-rw-r--r--go/reverse-string/cases_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/go/reverse-string/cases_test.go b/go/reverse-string/cases_test.go
new file mode 100644
index 0000000..ee46a78
--- /dev/null
+++ b/go/reverse-string/cases_test.go
@@ -0,0 +1,39 @@
+package reverse
+
+// Source: exercism/problem-specifications
+// Commit: 2f77985 reverse-string: apply "input" policy
+// Problem Specifications Version: 1.1.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",
+ },
+}