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

Commit b65626a

Browse files
committed
Add spec for handling paired characters
1 parent 665f099 commit b65626a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/spellchecker-spec.coffee

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ describe "SpellChecker", ->
2020
{start: 13, end: 18},
2121
]
2222

23+
it "accounts for UTF16 pairs correctly", ->
24+
string = "😎 cat caat dog dooog"
25+
26+
expect(SpellChecker.checkSpelling(string)).toEqual [
27+
{start: 7, end: 11},
28+
{start: 16, end: 21},
29+
]
30+
2331
describe ".getCorrectionsForMisspelling(word)", ->
2432
it "returns an array of possible corrections", ->
2533
corrections = SpellChecker.getCorrectionsForMisspelling('worrd')

0 commit comments

Comments
 (0)