@@ -135,32 +135,65 @@ TestRegister.addTests([
135135 } ,
136136 ] ,
137137 } ,
138+ {
139+ name : "ROT13: no shift amount" ,
140+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
141+ expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
142+ recipeConfig : [
143+ {
144+ op : "ROT13" ,
145+ args : [ true , true , true , 0 ]
146+ } ,
147+ ] ,
148+ } ,
138149 {
139150 name : "ROT13: normal" ,
140- input : "The Quick Brown Fox Jumped Over The Lazy Dog." ,
141- expectedOutput : "Gur Dhvpx Oebja Sbk Whzcrq Bire Gur Ynml Qbt." ,
151+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789 " ,
152+ expectedOutput : "Gur Dhvpx Oebja Sbk Whzcrq Bire Gur Ynml Qbt. 3456789012 " ,
142153 recipeConfig : [
143154 {
144155 op : "ROT13" ,
145156 args : [ true , true , true , 13 ]
146157 } ,
147158 ] ,
148159 } ,
160+ {
161+ name : "ROT13: negative shift amount" ,
162+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
163+ expectedOutput : "Gur Dhvpx Oebja Sbk Whzcrq Bire Gur Ynml Qbt. 7890123456" ,
164+ recipeConfig : [
165+ {
166+ op : "ROT13" ,
167+ args : [ true , true , true , - 13 ]
168+ } ,
169+ ] ,
170+ } ,
149171 {
150172 name : "ROT13: full loop" ,
151- input : "The Quick Brown Fox Jumped Over The Lazy Dog." ,
152- expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog." ,
173+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789 " ,
174+ expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog. 6789012345 " ,
153175 recipeConfig : [
154176 {
155177 op : "ROT13" ,
156178 args : [ true , true , true , 26 ]
157179 } ,
158180 ] ,
159181 } ,
182+ {
183+ name : "ROT13: full loop (negative shift amount)" ,
184+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
185+ expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog. 4567890123" ,
186+ recipeConfig : [
187+ {
188+ op : "ROT13" ,
189+ args : [ true , true , true , - 26 ]
190+ } ,
191+ ] ,
192+ } ,
160193 {
161194 name : "ROT13: lowercase only" ,
162- input : "The Quick Brown Fox Jumped Over The Lazy Dog." ,
163- expectedOutput : "Tur Qhvpx Bebja Fbk Jhzcrq Oire Tur Lnml Dbt." ,
195+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789 " ,
196+ expectedOutput : "Tur Qhvpx Bebja Fbk Jhzcrq Oire Tur Lnml Dbt. 0123456789 " ,
164197 recipeConfig : [
165198 {
166199 op : "ROT13" ,
@@ -170,15 +203,59 @@ TestRegister.addTests([
170203 } ,
171204 {
172205 name : "ROT13: uppercase only" ,
173- input : "The Quick Brown Fox Jumped Over The Lazy Dog." ,
174- expectedOutput : "Ghe Duick Orown Sox Wumped Bver Ghe Yazy Qog." ,
206+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789 " ,
207+ expectedOutput : "Ghe Duick Orown Sox Wumped Bver Ghe Yazy Qog. 0123456789 " ,
175208 recipeConfig : [
176209 {
177210 op : "ROT13" ,
178211 args : [ false , true , false , 13 ]
179212 } ,
180213 ] ,
181214 } ,
215+ {
216+ name : "ROT13: numbers only" ,
217+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
218+ expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog. 5678901234" ,
219+ recipeConfig : [
220+ {
221+ op : "ROT13" ,
222+ args : [ false , false , true , 5 ]
223+ } ,
224+ ] ,
225+ } ,
226+ {
227+ name : "ROT13: numbers only (negative shift amount)" ,
228+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
229+ expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog. 5678901234" ,
230+ recipeConfig : [
231+ {
232+ op : "ROT13" ,
233+ args : [ false , false , true , 5 ]
234+ } ,
235+ ] ,
236+ } ,
237+ {
238+ name : "ROT13: numbers only loop" ,
239+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
240+ expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
241+ recipeConfig : [
242+ {
243+ op : "ROT13" ,
244+ args : [ false , false , true , 10 ]
245+ } ,
246+ ] ,
247+ } ,
248+ {
249+ name : "ROT13: numbers only loop (negative shift amount)" ,
250+ input : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
251+ expectedOutput : "The Quick Brown Fox Jumped Over The Lazy Dog. 0123456789" ,
252+ recipeConfig : [
253+ {
254+ op : "ROT13" ,
255+ args : [ false , false , true , - 10 ]
256+ } ,
257+ ] ,
258+ } ,
182259 {
183260 name : "ROT47: nothing" ,
184261 input : "" ,
0 commit comments