Skip to content

Commit fdf8741

Browse files
committed
Simple-Cipher: Validating Input Strings
Expand unit tests for validating input strings as per issue exercism#1298. Three tests added covering: - Keys containing a single upper case letter. - Keys containing a space. - Keys containing a punctuation mark.
1 parent 7cea153 commit fdf8741

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

exercises/simple-cipher/canonical-data.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"expected": "qayaeaagaciai"
8888
},
8989
{
90-
"description": "Can wrap on encode",
90+
"description": "Can wrap on encode",
9191
"property": "encode",
9292
"input": {
9393
"key": "abcdefghij",
@@ -126,6 +126,14 @@
126126
},
127127
"expected": { "error": "Bad key" }
128128
},
129+
{
130+
"description": "Throws an error with a key mixing upper and lower case letters",
131+
"property": "new",
132+
"input": {
133+
"key": "abcdeFghij"
134+
},
135+
"expected": { "error": "Bad key" }
136+
},
129137
{
130138
"description": "Throws an error with a numeric key",
131139
"property": "new",
@@ -134,6 +142,22 @@
134142
},
135143
"expected": { "error": "Bad key" }
136144
},
145+
{
146+
"description": "Throws an error with a key containg a space",
147+
"property": "new",
148+
"input": {
149+
"key": "abcde fghij"
150+
},
151+
"expected": { "error": "Bad key" }
152+
},
153+
{
154+
"description": "Throws an error with a key containing a punctuation mark",
155+
"property": "new",
156+
"input": {
157+
"key": "abcde:fghij"
158+
},
159+
"expected": { "error": "Bad key" }
160+
},
137161
{
138162
"description": "Throws an error with empty key",
139163
"property": "new",

0 commit comments

Comments
 (0)