Bug 1250191 - Fix indentation in tests,r=MattN draft
authorMathieu Leplatre <mathieu@mozilla.com>
Mon, 18 Apr 2016 11:49:46 +0200
changeset 352656 81d4b653d6208db00c8db927177c4474b6b6544e
parent 352079 31c3377daf3a90ea48df6b74f89a3177b2da1889
child 352657 8855fa0850a26f6b0e40e64f5008820b954582ef
push id15734
push usermleplatre@mozilla.com
push dateMon, 18 Apr 2016 12:25:27 +0000
reviewersMattN
bugs1250191
milestone48.0a1
Bug 1250191 - Fix indentation in tests,r=MattN MozReview-Commit-ID: 9sXlff5qzaK
services/common/tests/unit/test_canonicaljson.js
--- a/services/common/tests/unit/test_canonicaljson.js
+++ b/services/common/tests/unit/test_canonicaljson.js
@@ -1,62 +1,60 @@
 const { CanonicalJSON } = Cu.import("resource://services-common/canonical-json.js");
 
 function stringRepresentation(obj) {
   const clone = JSON.parse(JSON.stringify(obj));
   return JSON.stringify(clone);
 }
 
 add_task(function* test_canonicalJSON_should_preserve_array_order() {
-    const input = ['one', 'two', 'three'];
-    // No sorting should be done on arrays.
-    do_check_eq(CanonicalJSON.stringify(input), '["one","two","three"]');
+  const input = ['one', 'two', 'three'];
+  // No sorting should be done on arrays.
+  do_check_eq(CanonicalJSON.stringify(input), '["one","two","three"]');
 });
 
 add_task(function* test_canonicalJSON_orders_object_keys() {
-    const input = [{
-      b: ['two', 'three'],
-      a: ['zero', 'one']
-    }];
-
-    do_check_eq(
-      CanonicalJSON.stringify(input),
-      '[{"a":["zero","one"],"b":["two","three"]}]'
-    );
+  const input = [{
+    b: ['two', 'three'],
+    a: ['zero', 'one']
+  }];
+  do_check_eq(
+    CanonicalJSON.stringify(input),
+    '[{"a":["zero","one"],"b":["two","three"]}]'
+  );
 });
 
 add_task(function* test_canonicalJSON_orders_nested_object_keys() {
-    const input = [{
-      b: {d: 'd', c: 'c'},
-      a: {b: 'b', a: 'a'}
-    }];
-
-    do_check_eq(
-      CanonicalJSON.stringify(input),
-      '[{"a":{"a":"a","b":"b"},"b":{"c":"c","d":"d"}}]'
-    );
+  const input = [{
+    b: {d: 'd', c: 'c'},
+    a: {b: 'b', a: 'a'}
+  }];
+  do_check_eq(
+    CanonicalJSON.stringify(input),
+    '[{"a":{"a":"a","b":"b"},"b":{"c":"c","d":"d"}}]'
+  );
 });
 
 add_task(function* test_canonicalJSON_escapes_unicode_values() {
-    do_check_eq(
-      CanonicalJSON.stringify([{key: '✓'}]),
-      '[{"key":"\\u2713"}]'
-    );
-    // Unicode codepoints should be output in lowercase.
-    do_check_eq(
-      CanonicalJSON.stringify([{key: 'é'}]),
-      '[{"key":"\\u00e9"}]'
-    );
+  do_check_eq(
+    CanonicalJSON.stringify([{key: '✓'}]),
+    '[{"key":"\\u2713"}]'
+  );
+  // Unicode codepoints should be output in lowercase.
+  do_check_eq(
+    CanonicalJSON.stringify([{key: 'é'}]),
+    '[{"key":"\\u00e9"}]'
+  );
 });
 
 add_task(function* test_canonicalJSON_escapes_unicode_object_keys() {
-    do_check_eq(
-      CanonicalJSON.stringify([{'é': 'check'}]),
-      '[{"\\u00e9":"check"}]'
-    );
+  do_check_eq(
+    CanonicalJSON.stringify([{'é': 'check'}]),
+    '[{"\\u00e9":"check"}]'
+  );
 });
 
 
 add_task(function* test_canonicalJSON_does_not_alter_input() {
   const records = [
     {'foo': 'bar', 'last_modified': '12345', 'id': '1'},
     {'bar': 'baz', 'last_modified': '45678', 'id': '2'}
   ];