Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,20 @@ test('clean: Should not throw exceptions when nothing but whitespace passed to f
)
t.is(filter.clean(''), '')
})

test('clean: Cleans non-english sentences', (t) => {
const filter = new Filter()

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)
})