File: slashEscape-test.js

package info (click to toggle)
node-v8-compile-cache 2.3.0-3%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 268 kB
  • sloc: javascript: 880; sh: 11; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';

const tap = require('tap');

process.env.DISABLE_V8_COMPILE_CACHE = 1;
const slashEscape = require('..').__TEST__.slashEscape;

var escapes = {
  '/a/b/c/d': 'zSazSbzSczSd',
  '/z/zZ/a/': 'zSzZzSzZZzSazS',
  'z:\\a/b': 'zZzCzBazSb',
  '\x00abc': 'z0abc',
};

tap.test('escape', t => {
  for (const key of Object.keys(escapes)) {
    t.equal(
      slashEscape(key),
      escapes[key]
    );
  }
  t.end();
});