Skip to content

Commit

Permalink
test(clean): add more assertions for non-english test-cases
Browse files Browse the repository at this point in the history
add tests for cn + jp
  • Loading branch information
web-mech committed Aug 27, 2024
1 parent 790e85f commit 8cf9b89
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,16 @@ test('clean: Should not throw exceptions when nothing but whitespace passed to f
test('clean: Cleans non-english sentences', (t) => {
const filter = new Filter()

const badwordtest = 'мило'
const teststring = filter.clean(badwordtest)
t.is(filter.clean(teststring), badwordtest)
const ruBadWordTest = 'мило'
const cnBadWordTest = '吃'
const jpBadWordTest = 'ワイン'

let teststring = filter.clean(ruBadWordTest)
t.is(filter.clean(teststring), ruBadWordTest)

teststring = filter.clean(cnBadWordTest)
t.is(filter.clean(teststring), cnBadWordTest)

teststring = filter.clean(jpBadWordTest)
t.is(filter.clean(teststring), jpBadWordTest)
})

0 comments on commit 8cf9b89

Please sign in to comment.