Skip to content

Commit cacf1f1

Browse files
Alexandersshine
authored andcommitted
Acronym: add underscore test case (#1436)
Many regular expression libraries have a way to detect word boundaries, but their definition of word characters includes underscores. \b and \w metacharacters were designed to detect programming language keywords, and it is a common mistake to use them to match words in natural languages.
1 parent 0c769d4 commit cacf1f1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

exercises/acronym/canonical-data.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"exercise": "acronym",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"cases": [
55
{
66
"description": "Abbreviate a phrase",
@@ -68,6 +68,14 @@
6868
"phrase": "Halley's Comet"
6969
},
7070
"expected": "HC"
71+
},
72+
{
73+
"description": "underscore emphasis",
74+
"property": "abbreviate",
75+
"input": {
76+
"phrase": "The Road _Not_ Taken"
77+
},
78+
"expected": "TRNT"
7179
}
7280
]
7381
}

0 commit comments

Comments
 (0)