mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Replace jssplitter with JavaScript
This commit is contained in:
@@ -30,3 +30,33 @@ describe('Basic html theme search', function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// This is regression test for https://github.com/sphinx-doc/sphinx/issues/3150
|
||||
describe('splitQuery regression tests', () => {
|
||||
|
||||
it('can split English words', () => {
|
||||
const parts = splitQuery(' Hello World ')
|
||||
expect(parts).toEqual(['Hello', 'World'])
|
||||
})
|
||||
|
||||
it('can split special characters', () => {
|
||||
const parts = splitQuery('Pin-Code')
|
||||
expect(parts).toEqual(['Pin', 'Code'])
|
||||
})
|
||||
|
||||
it('can split Chinese characters', () => {
|
||||
const parts = splitQuery('Hello from 中国 上海')
|
||||
expect(parts).toEqual(['Hello', 'from', '中国', '上海'])
|
||||
})
|
||||
|
||||
it('can split Emoji (surrogate pair) characters. It should keep emojis.', () => {
|
||||
const parts = splitQuery('😁😁')
|
||||
expect(parts).toEqual(['😁😁'])
|
||||
})
|
||||
|
||||
it('can split umlauts. It should keep umlauts.', () => {
|
||||
const parts = splitQuery('Löschen Prüfung Abändern ærlig spørsmål')
|
||||
expect(parts).toEqual(['Löschen', 'Prüfung', 'Abändern', 'ærlig', 'spørsmål'])
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user