aboutsummaryrefslogtreecommitdiff
path: root/integration/snapshots/latin1-chars-in-regexp.js
blob: 108874c39d0dbf738b083aef4eca56fa5a08f81c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
export var re_btou = new RegExp([
  "[\xC0-\xDF][\x80-\xBF]",
  "[\xE0-\xEF][\x80-\xBF]{2}",
  "[\xF0-\xF7][\x80-\xBF]{3}"
].join("|"), "g");
const encoder = new TextEncoder;
const realLines = [
  "[\xC0-\xDF][\x80-\xBF]",
  "[\xE0-\xEF][\x80-\xBF]{2}",
  "[\xF0-\xF7][\x80-\xBF]{3}"
];
const real = realLines.map((input) => Array.from(encoder.encode(input)));
const expected = [
  [91, 195, 128, 45, 195, 159, 93, 91, 194, 128, 45, 194, 191, 93],
  [
    91,
    195,
    160,
    45,
    195,
    175,
    93,
    91,
    194,
    128,
    45,
    194,
    191,
    93,
    123,
    50,
    125
  ],
  [
    91,
    195,
    176,
    45,
    195,
    183,
    93,
    91,
    194,
    128,
    45,
    194,
    191,
    93,
    123,
    51,
    125
  ]
];
const newlinePreserved = `\n`;
export function test() {
  if (!real.every((point, i) => point.every((val, j) => val === expected[i][j])))
    throw new Error(`test failed
${JSON.stringify({ expected, real }, null, 2)}`);
  if (newlinePreserved.length !== 1 || newlinePreserved.charCodeAt(0) !== 10)
    throw new Error("Newline was not preserved");
  const decoder = new TextDecoder("utf8");
  if (!realLines.every((line, i) => decoder.decode(Uint8Array.from(expected[i])) === line))
    throw new Error(`test failed. Lines did not match.
${JSON.stringify({ expected, real }, null, 2)}`);
  testDone(import.meta.url);
}

//# sourceMappingURL=http://localhost:8080/latin1-chars-in-regexp.js.map
@sap.com> * test: improve worker_threads UTs Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com> * test: fix lazy loading Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com> * test: fix worker_threads test Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org> * fix: return the worker threadId Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com> * test: refine worker_threads expectation on threadId Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org> --------- Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com> Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org> 2023-10-16Fix use before define bug in sqliteGravatar Ashcon Partovi 2-5/+5 Fixes #6481 2023-10-16fix(jest): fix toStrictEqual on same URLs (#6528)Gravatar João Alisson 2-13/+16 Fixes #6492 2023-10-16Fix `toHaveBeenCalled` having wrong error signatureGravatar Ashcon Partovi 1-2/+2 Fixes #6527 2023-10-16Fix formattingGravatar Ashcon Partovi 1-2/+1 2023-10-16Add `reusePort` to `Bun.serve` typesGravatar Ashcon Partovi 1-0/+9 2023-10-16Fix `request.url` having incorrect portGravatar Ashcon Partovi 4-1/+92 Fixes #6443 2023-10-16Remove uWebSockets header from Bun.serve responsesGravatar Ashcon Partovi 1-6/+6 2023-10-16Rename some testsGravatar Ashcon Partovi 3-0/+0 2023-10-16Fix #6467Gravatar Ashcon Partovi 2-3/+10 2023-10-16Update InternalModuleRegistryConstants.hGravatar Dylan Conway 1-3/+3 2023-10-16Development -> Contributing (#6538)Gravatar Colin McDonnell 2-1/+1 Co-authored-by: Colin McDonnell <colin@KennyM1.local> 2023-10-14fix(net/tls) fix pg hang on end + hanging on query (#6487)Gravatar Ciro Spaciari 3-8/+36 * fix pg hang on end + hanging on query * remove dummy function * fix node-stream * add test * fix test * return error in test * fix test use once instead of on * fix OOM * generated * 💅 * 💅 2023-10-13fix installing dependencies that match workspace versions (#6494)Gravatar Dylan Conway 4-2/+64 * check if dependency matches workspace version * test * Update lockfile.zig * set resolution to workspace package id 2023-10-13fix lockfile struct padding (#6495)Gravatar Dylan Conway 3-3/+18 * integrity padding * error message for bytes at end of struct