Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 5e56852

Browse files
committed
Add test for non-word characters
1 parent ab01262 commit 5e56852

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spec/spellchecker-spec.coffee

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@ describe "SpellChecker", ->
2020
{start: 13, end: 18},
2121
]
2222

23-
it "accounts for UTF16 pairs correctly", ->
23+
it "accounts for UTF16 pairs", ->
2424
string = "😎 cat caat dog dooog"
2525

2626
expect(SpellChecker.checkSpelling(string)).toEqual [
2727
{start: 7, end: 11},
2828
{start: 16, end: 21},
2929
]
3030

31+
it "accounts for other non-word characters", ->
32+
string = "'cat' (caat. dog:dooog)"
33+
expect(SpellChecker.checkSpelling(string)).toEqual [
34+
{start: 7, end: 11},
35+
{start: 17, end: 22},
36+
]
37+
3138
describe ".getCorrectionsForMisspelling(word)", ->
3239
it "returns an array of possible corrections", ->
3340
corrections = SpellChecker.getCorrectionsForMisspelling('worrd')

0 commit comments

Comments
 (0)