summaryrefslogtreecommitdiffstats
path: root/node_modules/saslprep/test/index.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/saslprep/test/index.js
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/saslprep/test/index.js')
-rw-r--r--node_modules/saslprep/test/index.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/node_modules/saslprep/test/index.js b/node_modules/saslprep/test/index.js
deleted file mode 100644
index 80c71af..0000000
--- a/node_modules/saslprep/test/index.js
+++ /dev/null
@@ -1,76 +0,0 @@
-'use strict';
-
-const saslprep = require('..');
-
-const chr = String.fromCodePoint;
-
-test('should work with liatin letters', () => {
- const str = 'user';
- expect(saslprep(str)).toEqual(str);
-});
-
-test('should work be case preserved', () => {
- const str = 'USER';
- expect(saslprep(str)).toEqual(str);
-});
-
-test('should work with high code points (> U+FFFF)', () => {
- const str = '\uD83D\uDE00';
- expect(saslprep(str, { allowUnassigned: true })).toEqual(str);
-});
-
-test('should remove `mapped to nothing` characters', () => {
- expect(saslprep('I\u00ADX')).toEqual('IX');
-});
-
-test('should replace `Non-ASCII space characters` with space', () => {
- expect(saslprep('a\u00A0b')).toEqual('a\u0020b');
-});
-
-test('should normalize as NFKC', () => {
- expect(saslprep('\u00AA')).toEqual('a');
- expect(saslprep('\u2168')).toEqual('IX');
-});
-
-test('should throws when prohibited characters', () => {
- // C.2.1 ASCII control characters
- expect(() => saslprep('a\u007Fb')).toThrow();
-
- // C.2.2 Non-ASCII control characters
- expect(() => saslprep('a\u06DDb')).toThrow();
-
- // C.3 Private use
- expect(() => saslprep('a\uE000b')).toThrow();
-
- // C.4 Non-character code points
- expect(() => saslprep(`a${chr(0x1fffe)}b`)).toThrow();
-
- // C.5 Surrogate codes
- expect(() => saslprep('a\uD800b')).toThrow();
-
- // C.6 Inappropriate for plain text
- expect(() => saslprep('a\uFFF9b')).toThrow();
-
- // C.7 Inappropriate for canonical representation
- expect(() => saslprep('a\u2FF0b')).toThrow();
-
- // C.8 Change display properties or are deprecated
- expect(() => saslprep('a\u200Eb')).toThrow();
-
- // C.9 Tagging characters
- expect(() => saslprep(`a${chr(0xe0001)}b`)).toThrow();
-});
-
-test('should not containt RandALCat and LCat bidi', () => {
- expect(() => saslprep('a\u06DD\u00AAb')).toThrow();
-});
-
-test('RandALCat should be first and last', () => {
- expect(() => saslprep('\u0627\u0031\u0628')).not.toThrow();
- expect(() => saslprep('\u0627\u0031')).toThrow();
-});
-
-test('should handle unassigned code points', () => {
- expect(() => saslprep('a\u0487')).toThrow();
- expect(() => saslprep('a\u0487', { allowUnassigned: true })).not.toThrow();
-});