mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-09 10:25:32 +00:00
chore(web): where'd that extra indentation come from?
This commit is contained in:
parent
a09cc5d822
commit
413e88daa2
1 changed files with 28 additions and 28 deletions
|
|
@ -2,34 +2,34 @@
|
|||
* Smoke-test the default
|
||||
*/
|
||||
|
||||
const assert = require('chai').assert;
|
||||
const breakWords = require('../build').wordBreakers['default'];
|
||||
const assert = require('chai').assert;
|
||||
const breakWords = require('../build').wordBreakers['default'];
|
||||
|
||||
const SHY = '\u00AD'; // Other, Format. The "Soft HYphen" - usually invisible unless needed for word-wrapping.
|
||||
const SHY = '\u00AD'; // Other, Format. The "Soft HYphen" - usually invisible unless needed for word-wrapping.
|
||||
|
||||
describe('The default word breaker', function () {
|
||||
it('should break multilingual text', function () {
|
||||
let breaks = breakWords(
|
||||
`Добрый день! ᑕᐻ᙮ — after working on ka${SHY}wen${SHY}non:${SHY}nis,
|
||||
let's eat phở! 🥣`
|
||||
);
|
||||
let words = breaks.map(span => span.text);
|
||||
assert.deepEqual(words, [
|
||||
'Добрый', 'день', '!', 'ᑕᐻ', '᙮', '—', 'after',
|
||||
'working', 'on', `ka${SHY}wen${SHY}non:${SHY}nis`, ',',
|
||||
"let's", 'eat', 'phở', '!', '🥣'
|
||||
]);
|
||||
});
|
||||
describe('The default word breaker', function () {
|
||||
it('should break multilingual text', function () {
|
||||
let breaks = breakWords(
|
||||
`Добрый день! ᑕᐻ᙮ — after working on ka${SHY}wen${SHY}non:${SHY}nis,
|
||||
let's eat phở! 🥣`
|
||||
);
|
||||
let words = breaks.map(span => span.text);
|
||||
assert.deepEqual(words, [
|
||||
'Добрый', 'день', '!', 'ᑕᐻ', '᙮', '—', 'after',
|
||||
'working', 'on', `ka${SHY}wen${SHY}non:${SHY}nis`, ',',
|
||||
"let's", 'eat', 'phở', '!', '🥣'
|
||||
]);
|
||||
});
|
||||
|
||||
it('handles heavily-punctuated English text', function() {
|
||||
// This test case brought to you by http://unicode.org/reports/tr29/#Word_Boundaries, Figure 1.
|
||||
let breaks = breakWords(
|
||||
`The quick ("brown") fox can't jump 32.3 feet, right?`
|
||||
);
|
||||
let words = breaks.map(span => span.text);
|
||||
assert.deepEqual(words, [
|
||||
'The', 'quick', '(', '"', 'brown', '"', ')', 'fox', "can't",
|
||||
'jump', '32.3', 'feet', ',', 'right', '?'
|
||||
]);
|
||||
});
|
||||
});
|
||||
it('handles heavily-punctuated English text', function() {
|
||||
// This test case brought to you by http://unicode.org/reports/tr29/#Word_Boundaries, Figure 1.
|
||||
let breaks = breakWords(
|
||||
`The quick ("brown") fox can't jump 32.3 feet, right?`
|
||||
);
|
||||
let words = breaks.map(span => span.text);
|
||||
assert.deepEqual(words, [
|
||||
'The', 'quick', '(', '"', 'brown', '"', ')', 'fox', "can't",
|
||||
'jump', '32.3', 'feet', ',', 'right', '?'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue