PHP Classes

File: public/js/tinymce/src/plugins/wordcount/src/test/js/atomic/core/WordGetterTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/wordcount/src/test/js/atomic/core/WordGetterTest.js   Download  
File: public/js/tinymce/src/plugins/wordcount/src/test/js/atomic/core/WordGetterTest.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 2,132 bytes
 

Contents

Class file image Download
test( 'atomic.core.WordGetterTest', [ 'tinymce.plugins.wordcount.text.WordGetter' ], function (WordGetter) { var getWords = WordGetter.getWords; var testGetWords = function () { // splits words on whitespace assert.eq(['hello', 'world'], getWords('hello world')); // does not split on numeric separators assert.eq(['the', 'price', 'is', '3,500.50'], getWords('the price is 3,500.50')); // does not split on katakana words assert.eq(['?', '?', '?', '?', '?', '?????'], getWords('??????????')); // removes punctuation by default assert.eq(['a', 'b'], getWords('a .... b')); // but keeps with setting assert.eq(['a', '.', '.', '.', '.', 'b'], getWords('a .... b', { includePunctuation: true })); // keeps whitespace with setting assert.eq(['a', ' ', ' ', ' ', 'b'], getWords('a b', { includeWhitespace: true })); // ignores case with setting assert.eq(['hello', 'world'], getWords('HELLO World', { ignoreCase: true })); assert.eq(['http://www.google.com'], getWords('http://www.google.com')); assert.eq(['https://www.google.com'], getWords('https://www.google.com')); assert.eq(['bengt@mail.se'], getWords('bengt@mail.se')); assert.eq(['bengt@mail.se', 'abc'], getWords('bengt@mail.se abc')); assert.eq(['http://www.google.com', 'abc'], getWords('http://www.google.com abc')); assert.eq(['ab'], getWords('a\ufeffb')); assert.eq(['1+1*1/1?1=1'], getWords('1+1*1/1?1=1')); assert.eq(['50-10'], getWords('50-10')); assert.eq(['jack-in-the-box'], getWords('jack-in-the-box')); assert.eq(['n=13'], getWords('n=13')); assert.eq(['n<13'], getWords('n<13')); assert.eq(['1<13'], getWords('1<13')); assert.eq(['n>13'], getWords('n>13')); assert.eq(['1>13'], getWords('1>13')); assert.eq(['n?13'], getWords('n?13')); assert.eq(['1?13'], getWords('1?13')); assert.eq(['n?13'], getWords('n?13')); assert.eq(['1?13'], getWords('1?13')); }; testGetWords(); } );