summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/tests/xpcshell/test_jsesc.js
blob: 577065010543962979b515f1daa984774aee7969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

const { jsesc } = ChromeUtils.importESModule(
  "resource://gre/modules/third_party/jsesc/jsesc.mjs"
);

function run_test() {
  Assert.equal(jsesc("teééést", { lowercaseHex: true }), "te\\xe9\\xe9\\xe9st");
  Assert.equal(
    jsesc("teééést", { lowercaseHex: false }),
    "te\\xE9\\xE9\\xE9st"
  );
}