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

Commit

Permalink
Add test for non-word characters
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunsfeld committed Jan 6, 2016
1 parent ab01262 commit 5e56852
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/spellchecker-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,21 @@ describe "SpellChecker", ->
{start: 13, end: 18},
]

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

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

it "accounts for other non-word characters", ->
string = "'cat' (caat. dog:dooog)"
expect(SpellChecker.checkSpelling(string)).toEqual [
{start: 7, end: 11},
{start: 17, end: 22},
]

describe ".getCorrectionsForMisspelling(word)", ->
it "returns an array of possible corrections", ->
corrections = SpellChecker.getCorrectionsForMisspelling('worrd')
Expand Down

0 comments on commit 5e56852

Please sign in to comment.