Commit 81e2514c authored by Geoff Simmons's avatar Geoff Simmons

base64 tests less verbose

parent c045a5ac
...@@ -11,41 +11,45 @@ varnish v1 -vcl { ...@@ -11,41 +11,45 @@ varnish v1 -vcl {
} }
sub vcl_synth { sub vcl_synth {
set req.http.pangram
= "The quick brown fox jumps over the lazy dog";
set req.http.hobbes =
{"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."};
# hex encoding of all 256 byte values in descending order
set req.http.hexall =
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"};
set resp.http.b64 = set resp.http.b64 =
convert.encode(BASE64, convert.decode(IDENTITY, convert.encode(BASE64, convert.decode(IDENTITY, req.http.pangram));
"The quick brown fox jumps over the lazy dog"));
set resp.http.b64hobbes = set resp.http.b64hobbes =
convert.encode(BASE64, convert.decode(IDENTITY, convert.encode(BASE64, convert.decode(IDENTITY, req.http.hobbes));
{"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."}));
set resp.http.b64all = set resp.http.b64all =
convert.encode(BASE64, convert.decode(HEX, convert.encode(BASE64, convert.decode(HEX, req.http.hexall));
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"}));
set resp.http.b64url = set resp.http.b64url =
convert.encode(BASE64URL, convert.decode(IDENTITY, convert.encode(BASE64URL,
"The quick brown fox jumps over the lazy dog")); convert.decode(IDENTITY, req.http.pangram));
set resp.http.b64urlhobbes = set resp.http.b64urlhobbes =
convert.encode(BASE64URL, convert.decode(IDENTITY, convert.encode(BASE64URL,
{"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."})); convert.decode(IDENTITY, req.http.hobbes));
set resp.http.b64urlall = set resp.http.b64urlall =
convert.encode(BASE64URL, convert.decode(HEX, convert.encode(BASE64URL, convert.decode(HEX, req.http.hexall));
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"}));
set resp.http.b64urlnopad = set resp.http.b64urlnopad =
convert.encode(BASE64URLNOPAD, convert.decode(IDENTITY, convert.encode(BASE64URLNOPAD, convert.decode(IDENTITY,
"The quick brown fox jumps over the lazy dog")); "The quick brown fox jumps over the lazy dog"));
set resp.http.b64nopadhobbes = set resp.http.b64nopadhobbes =
convert.encode(BASE64URLNOPAD, convert.decode(IDENTITY, convert.encode(BASE64URLNOPAD,
{"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."})); convert.decode(IDENTITY, req.http.hobbes));
set resp.http.b64nopadall = set resp.http.b64nopadall =
convert.encode(BASE64URLNOPAD, convert.decode(HEX, convert.encode(BASE64URLNOPAD,
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"})); convert.decode(HEX, req.http.hexall));
set resp.http.b64empty = set resp.http.b64empty =
convert.encode(BASE64, convert.decode(IDENTITY, "")); convert.encode(BASE64, convert.decode(IDENTITY, ""));
...@@ -55,18 +59,15 @@ varnish v1 -vcl { ...@@ -55,18 +59,15 @@ varnish v1 -vcl {
convert.encode(BASE64URLNOPAD, convert.decode(IDENTITY, "")); convert.encode(BASE64URLNOPAD, convert.decode(IDENTITY, ""));
set resp.http.b64param = set resp.http.b64param =
convert.encode(blob=convert.decode(IDENTITY, convert.encode(blob=convert.decode(IDENTITY, req.http.pangram),
"The quick brown fox jumps over the lazy dog"),
encoding=BASE64); encoding=BASE64);
set resp.http.b64urlparam = set resp.http.b64urlparam =
convert.encode(blob=convert.decode(IDENTITY, convert.encode(blob=convert.decode(IDENTITY, req.http.pangram),
"The quick brown fox jumps over the lazy dog"),
encoding=BASE64URL); encoding=BASE64URL);
set resp.http.b64urlnopadparam = set resp.http.b64urlnopadparam =
convert.encode(blob=convert.decode(IDENTITY, convert.encode(blob=convert.decode(IDENTITY, req.http.pangram),
"The quick brown fox jumps over the lazy dog"),
encoding=BASE64URLNOPAD); encoding=BASE64URLNOPAD);
set resp.http.b64xcode = set resp.http.b64xcode =
...@@ -114,38 +115,44 @@ varnish v1 -vcl { ...@@ -114,38 +115,44 @@ varnish v1 -vcl {
} }
sub vcl_synth { sub vcl_synth {
set req.http.foobarbazquux = "L0hlbGxvIHdvcmxkLw==";
set req.http.pangram
= "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==";
set req.http.hobbes =
{"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="};
set req.http.hobbesnopad = regsuball(req.http.hobbes, "=", "");
set req.http.all =
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999++++////"};
set req.http.allurl =
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999----____"};
set resp.http.dec = convert.encode(IDENTITY, set resp.http.dec = convert.encode(IDENTITY,
convert.decode(BASE64, "L0hlbGxvIHdvcmxkLw==")); convert.decode(BASE64, req.http.foobarbazquux));
set resp.http.dec2 set resp.http.dec2
= convert.encode(IDENTITY, = convert.encode(IDENTITY,
convert.decode(BASE64, convert.decode(BASE64, req.http.pangram));
"VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="
));
set resp.http.b64dechobbes = set resp.http.b64dechobbes =
convert.encode(IDENTITY, convert.decode(BASE64, convert.encode(IDENTITY, convert.decode(BASE64, req.http.hobbes));
{"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="}));
set resp.http.b64decall = set resp.http.b64decall =
convert.encode(HEXLC, convert.decode(BASE64, convert.encode(HEXLC, convert.decode(BASE64, req.http.all));
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999++++////"}));
set resp.http.urldechobbes = set resp.http.urldechobbes =
convert.encode(IDENTITY, convert.decode(BASE64URL, convert.encode(IDENTITY, convert.decode(BASE64URL,
{"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="})); req.http.hobbes));
set resp.http.urldecall = set resp.http.urldecall =
convert.encode(HEXLC, convert.decode(BASE64URL, convert.encode(HEXLC, convert.decode(BASE64URL, req.http.allurl));
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999----____"}));
set resp.http.nopaddechobbes = set resp.http.nopaddechobbes =
convert.encode(IDENTITY, convert.decode(BASE64URLNOPAD, convert.encode(IDENTITY, convert.decode(BASE64URLNOPAD,
{"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4"})); req.http.hobbesnopad));
set resp.http.nopaddecall = set resp.http.nopaddecall =
convert.encode(HEXLC, convert.decode(BASE64URLNOPAD, convert.encode(HEXLC,
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999----____"})); convert.decode(BASE64URLNOPAD, req.http.allurl));
set resp.http.b64empty = set resp.http.b64empty =
convert.encode(IDENTITY, convert.decode(BASE64, "")); convert.encode(IDENTITY, convert.decode(BASE64, ""));
...@@ -160,7 +167,7 @@ varnish v1 -vcl { ...@@ -160,7 +167,7 @@ varnish v1 -vcl {
set resp.http.decenc set resp.http.decenc
= convert.encode(BASE64, = convert.encode(BASE64,
convert.decode(BASE64, "L0hlbGxvIHdvcmxkLw==")); convert.decode(BASE64, req.http.foobarbazquux));
set resp.http.l = "L"; set resp.http.l = "L";
set resp.http.dec2pieces set resp.http.dec2pieces
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment