Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 Cu.import("resource://services-common/utils.js");
6 function run_test() {
7 run_next_test();
8 }
10 add_test(function test_simple() {
11 let expected = {
12 hello: "aGVsbG8=",
13 "<>?": "PD4_",
14 };
16 for (let [k, v] in Iterator(expected)) {
17 do_check_eq(CommonUtils.encodeBase64URL(k), v);
18 }
20 run_next_test();
21 });
23 add_test(function test_no_padding() {
24 do_check_eq(CommonUtils.encodeBase64URL("hello", false), "aGVsbG8");
26 run_next_test();
27 });