Fix the remaining tests that were failing.

This commit is contained in:
Ross Boucher
2010-02-21 13:02:52 -08:00
parent 7433c38d92
commit 6ddeff2b21
2 changed files with 5 additions and 3 deletions
+3 -3
View File
@@ -101,7 +101,7 @@ var base64_map_to = [
for (var i = 0; i < base64_map_to.length; i++)
base64_map_from[base64_map_to[i].charCodeAt(0)] = i;
function base64_decode_to_array(input, strip)
GLOBAL(base64_decode_to_array) = function(input, strip)
{
if (strip)
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
@@ -130,7 +130,7 @@ function base64_decode_to_array(input, strip)
return output;
}
function base64_encode_array(input)
GLOBAL(base64_encode_array) = function(input)
{
var pad = (3 - (input.length % 3)) % 3,
length = input.length + pad,
@@ -168,7 +168,7 @@ function base64_encode_array(input)
return output.join("");
}
function base64_decode_to_string(input, strip)
GLOBAL(base64_decode_to_string) = function(input, strip)
{
return bytes_to_string(base64_decode_to_array(input, strip));
}
+2
View File
@@ -1,3 +1,5 @@
@import <Foundation/CPData.j>
var base64TestStrings = [
["leasure.", "bGVhc3VyZS4="],
["easure.", "ZWFzdXJlLg=="],