Skip to content

Commit

Permalink
test(Aliases): Unicode test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
about-code committed Sep 26, 2019
1 parent f19bad7 commit ab6ec64
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions test/input/features/aliases_and_synonyms/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Aliases: 中国zhōngguó, zhōngguó中国, 中zhōngguó国, zhōng中国guó -->
GIVEN there is an HTML-single-line-comment beginning with 'Aliases:'
AND aliases contain unicode word characters
THEN they MUST still be separated correctly
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@ 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

[3]: glossary.md#term-3

[4]: glossary.md#term-4

[5]: glossary.md#china
10 changes: 10 additions & 0 deletions test/output-expected/features/aliases_and_synonyms/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- Aliases: 中国zhōngguó, zhōngguó中国, 中zhōngguó国, zhōng中国guó -->

GIVEN there is an HTML-single-line-comment beginning with 'Aliases:'
AND aliases contain unicode word characters
THEN they MUST still be separated correctly
37 changes: 37 additions & 0 deletions test/output-expected/terms.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
}
]

0 comments on commit ab6ec64

Please sign in to comment.