@@ -33,6 +33,94 @@ projects:
3333 - " *"
3434 transformations :
3535 - " splitlines"
36+ base64_encode_decode :
37+ words :
38+ - " base64"
39+ - " encode"
40+ - " decode"
41+ requires_parameters : true
42+ tests :
43+ base64_encode_valid :
44+ params :
45+ - name : " lowercase string"
46+ input : ' "encode" "hello world"'
47+ expected : " aGVsbG8gd29ybGQ="
48+ - name : " long string"
49+ input : ' "encode" "They swam along the boat at incredible speeds."'
50+ expected : " VGhleSBzd2FtIGFsb25nIHRoZSBib2F0IGF0IGluY3JlZGlibGUgc3BlZWRzLg=="
51+ - name : " numbers"
52+ input : ' "encode" "1234567890"'
53+ expected : " MTIzNDU2Nzg5MA=="
54+ - name : " symbols"
55+ input : |
56+ "encode" "x!\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~"
57+ expected : " eCEiIyQlJicoKSorLC0uLzo7PD0+P0BbXF1eX2B7fH1+"
58+ - name : " all base64 characters"
59+ input : ' "encode" "! }gggIIT55;qqs!!Gjjb??=~~2$$+;;i::x..4kk,ppnoo"'
60+ expected : " ISAgfWdnZ0lJVDU1O3FxcyEhR2pqYj8/PX5+MiQkKzs7aTo6eC4uNGtrLHBwbm9v"
61+ transformations :
62+ - " strip"
63+ base64_decode_valid :
64+ params :
65+ - name : " lowercase string"
66+ input : ' "decode" "aGVsbG8gd29ybGQ="'
67+ expected : " hello world"
68+ - name : " long string"
69+ input : ' "decode" "VGhleSBzd2FtIGFsb25nIHRoZSBib2F0IGF0IGluY3JlZGlibGUgc3BlZWRzLg=="'
70+ expected : " They swam along the boat at incredible speeds."
71+ - name : " numbers"
72+ input : ' "decode" "MTIzNDU2Nzg5MA=="'
73+ expected : " 1234567890"
74+ - name : " symbols"
75+ input : ' "decode" "eCEiIyQlJicoKSorLC0uLzo7PD0+P0BbXF1eX2B7fH1+"'
76+ expected : " x!\" #$%&'()*+,-./:;<=>?@[\\\\ ]^_`{|}~"
77+ - name : " all base64 characters"
78+ input : ' "decode" "ISAgfWdnZ0lJVDU1O3FxcyEhR2pqYj8/PX5+MiQkKzs7aTo6eC4uNGtrLHBwbm9v"'
79+ expected : " ! }gggIIT55;qqs!!Gjjb??=~~2$$+;;i::x..4kk,ppnoo"
80+ transformations :
81+ - " strip"
82+ base64_invalid_inputs :
83+ params :
84+ - name : " no input"
85+ input : null
86+ expected : " Usage: please provide a mode and a string to encode/decode"
87+ - name : " invalid mode"
88+ input : ' "blue" "Oh look a Pascal triangle"'
89+ expected : " Usage: please provide a mode and a string to encode/decode"
90+ transformations :
91+ - " strip"
92+ base64_invalid_encode :
93+ params :
94+ - name : " missing string"
95+ input : ' "encode"'
96+ expected : " Usage: please provide a mode and a string to encode/decode"
97+ - name : " empty string"
98+ input : ' "encode" ""'
99+ expected : " Usage: please provide a mode and a string to encode/decode"
100+ transformations :
101+ - " strip"
102+ base64_invalid_decode :
103+ params :
104+ - name : " missing string"
105+ input : ' "decode"'
106+ expected : " Usage: please provide a mode and a string to encode/decode"
107+ - name : " empty string"
108+ input : ' "decode" ""'
109+ expected : " Usage: please provide a mode and a string to encode/decode"
110+ - name : " length number not multiple of 4"
111+ input : ' "decode" "hello+world"'
112+ expected : " Usage: please provide a mode and a string to encode/decode"
113+ - name : " invalid characters"
114+ input : ' "decode" "hello world="'
115+ expected : " Usage: please provide a mode and a string to encode/decode"
116+ - name : " too many pad characters at end"
117+ input : ' "decode" "MTIzNDU2Nzg5M==="'
118+ expected : " Usage: please provide a mode and a string to encode/decode"
119+ - name : " pad characters in middle"
120+ input : ' "decode" "MTIzNDU2=Nzg5M=="'
121+ expected : " Usage: please provide a mode and a string to encode/decode"
122+ transformations :
123+ - " strip"
36124 binarysearch :
37125 words :
38126 - " binary"
0 commit comments