From ab6ec645d721a76f77048e5559b258dbc4a93b76 Mon Sep 17 00:00:00 2001 From: about-code Date: Thu, 26 Sep 2019 17:14:33 +0200 Subject: [PATCH] test(Aliases): Unicode test cases --- .../aliases_and_synonyms.md | 8 ++++ .../features/aliases_and_synonyms/glossary.md | 9 +++++ .../aliases_and_synonyms.md | 10 +++++ .../features/aliases_and_synonyms/glossary.md | 10 +++++ test/output-expected/terms.json | 37 +++++++++++++++++++ 5 files changed, 74 insertions(+) diff --git a/test/input/features/aliases_and_synonyms/aliases_and_synonyms.md b/test/input/features/aliases_and_synonyms/aliases_and_synonyms.md index 41d04725..d08b35e6 100644 --- a/test/input/features/aliases_and_synonyms/aliases_and_synonyms.md +++ b/test/input/features/aliases_and_synonyms/aliases_and_synonyms.md @@ -17,3 +17,11 @@ GIVEN there is term "Term 4" THEN it MUST be replaced with a link to its definit GIVEN there is the term's alias "T4 Alias1" THEN it MUST be replaced with a link to the term's definition. GIVEN there is the term's alias "T4-Alias2" THEN it MUST be replaced with a link to the term's definition. GIVEN there is the term's alias "T4.Alias3" THEN it MUST be replaced with a link to the term's definition. + +GIVEN a term "China" +AND alias 中国zhōngguó +AND alias zhōngguó中国 +AND alias 中zhōngguó国 +AND alias zhōng中国guó +WITH aliases containing non-ASCII unicode characters +THEN all aliases MUST still be separated and linked correctly diff --git a/test/input/features/aliases_and_synonyms/glossary.md b/test/input/features/aliases_and_synonyms/glossary.md index fae0d0c2..4e33d01f 100644 --- a/test/input/features/aliases_and_synonyms/glossary.md +++ b/test/input/features/aliases_and_synonyms/glossary.md @@ -40,3 +40,12 @@ GIVEN there is an HTML-single-line-comment beginning with 'Aliases:' AND the comment ends with a trailing comma THEN this MUST NOT result in an infinite loop or out-of-memory error as has been reported in #26 + + +## Unicode Support + +### China + +GIVEN there is an HTML-single-line-comment beginning with 'Aliases:' +AND aliases contain unicode word characters +THEN they MUST still be separated correctly diff --git a/test/output-expected/features/aliases_and_synonyms/aliases_and_synonyms.md b/test/output-expected/features/aliases_and_synonyms/aliases_and_synonyms.md index bddd6c84..accc68ae 100644 --- a/test/output-expected/features/aliases_and_synonyms/aliases_and_synonyms.md +++ b/test/output-expected/features/aliases_and_synonyms/aliases_and_synonyms.md @@ -18,6 +18,14 @@ GIVEN there is the term's alias "[T4 Alias1][4]" THEN it MUST be replaced with a GIVEN there is the term's alias "[T4-Alias2][4]" THEN it MUST be replaced with a link to the term's definition. GIVEN there is the term's alias "[T4.Alias3][4]" THEN it MUST be replaced with a link to the term's definition. +GIVEN a term "[China][5]" +AND alias [中国zhōngguó][5] +AND alias [zhōngguó中国][5] +AND alias [中zhōngguó国][5] +AND alias [zhōng中国guó][5] +WITH aliases containing non-ASCII unicode characters +THEN all aliases MUST still be separated and linked correctly + [1]: glossary.md#term-1 [2]: glossary.md#term-2 @@ -25,3 +33,5 @@ GIVEN there is the term's alias "[T4.Alias3][4]" THEN it MUST be replaced with a [3]: glossary.md#term-3 [4]: glossary.md#term-4 + +[5]: glossary.md#china diff --git a/test/output-expected/features/aliases_and_synonyms/glossary.md b/test/output-expected/features/aliases_and_synonyms/glossary.md index b9bfb68a..0f7a3c1f 100644 --- a/test/output-expected/features/aliases_and_synonyms/glossary.md +++ b/test/output-expected/features/aliases_and_synonyms/glossary.md @@ -50,3 +50,13 @@ GIVEN there is an HTML-single-line-comment beginning with 'Aliases:' AND the comment ends with a trailing comma THEN this MUST NOT result in an infinite loop or out-of-memory error as has been reported in #26 + +## [Unicode Support](#unicode-support) + +### [China](#china) + + + +GIVEN there is an HTML-single-line-comment beginning with 'Aliases:' +AND aliases contain unicode word characters +THEN they MUST still be separated correctly diff --git a/test/output-expected/terms.json b/test/output-expected/terms.json index 3104c03e..aa01faa1 100644 --- a/test/output-expected/terms.json +++ b/test/output-expected/terms.json @@ -31,6 +31,27 @@ "aliases": [], "ignoreCase": false }, + { + "shortDesc": "", + "term": "China", + "hint": "", + "longDesc": "GIVEN there is an HTML-single-line-comment beginning with 'Aliases:'\nAND aliases contain unicode word characters\nTHEN they MUST still be separated correctly", + "anchor": "#china", + "glossary": { + "file": "./features/aliases_and_synonyms/glossary.md", + "termHint": "", + "basePath": "/{redacted}/input/features/aliases_and_synonyms/glossary.md", + "outPath": "/{redacted}/output-actual/features/aliases_and_synonyms/glossary.md" + }, + "regex": {}, + "aliases": [ + "中国zhōngguó", + "zhōngguó中国", + "中zhōngguó国", + "zhōng中国guó" + ], + "ignoreCase": false + }, { "shortDesc": "", "term": "Der Tod und das Mädchen", @@ -385,5 +406,21 @@ "regex": {}, "aliases": [], "ignoreCase": false + }, + { + "shortDesc": "", + "term": "Unicode Support", + "hint": "", + "longDesc": "", + "anchor": "#unicode-support", + "glossary": { + "file": "./features/aliases_and_synonyms/glossary.md", + "termHint": "", + "basePath": "/{redacted}/input/features/aliases_and_synonyms/glossary.md", + "outPath": "/{redacted}/output-actual/features/aliases_and_synonyms/glossary.md" + }, + "regex": {}, + "aliases": [], + "ignoreCase": false } ]