PHP Classes

File: public/js/tinymce/src/plugins/wordcount/src/test/js/atomic/core/StringMapperTest.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/StringMapperTest.js   Download  
File: public/js/tinymce/src/plugins/wordcount/src/test/js/atomic/core/StringMapperTest.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: 1,840 bytes
 

Contents

Class file image Download
test('atomic.core.StringMapperTest', [ 'tinymce.plugins.wordcount.text.StringMapper', 'tinymce.plugins.wordcount.text.UnicodeData' ], function (StringMapper, UnicodeData) { var ci = UnicodeData.characterIndices; var ALETTER = ci.ALETTER; var MIDNUMLET = ci.MIDNUMLET; var MIDLETTER = ci.MIDLETTER; var MIDNUM = ci.MIDNUM; var NUMERIC = ci.NUMERIC; var CR = ci.CR; var LF = ci.LF; var NEWLINE = ci.NEWLINE; var EXTEND = ci.EXTEND; var FORMAT = ci.FORMAT; var KATAKANA = ci.KATAKANA; var EXTENDNUMLET = ci.EXTENDNUMLET; var OTHER = ci.OTHER; var AT = ci.AT; var classify = StringMapper.classify; var testClassify = function () { assert.eq([ALETTER, ALETTER, ALETTER], classify("abc")); assert.eq([ALETTER, ALETTER, ALETTER], classify("هنِ")); assert.eq([ALETTER, NUMERIC, ALETTER], classify("a2c")); assert.eq([ALETTER, MIDNUMLET, ALETTER, ALETTER, OTHER, ALETTER, ALETTER, ALETTER, ALETTER, ALETTER], classify("a'la carte")); assert.eq([ALETTER, ALETTER, ALETTER, OTHER, LF, OTHER, ALETTER, ALETTER, ALETTER], classify("one \n two")); assert.eq([NUMERIC, MIDNUM, NUMERIC, NUMERIC, NUMERIC, MIDNUMLET, NUMERIC, NUMERIC], classify("3,500.10")); assert.eq([OTHER, KATAKANA, KATAKANA], classify('???')); assert.eq([OTHER, OTHER], classify('??')); assert.eq([MIDLETTER], classify('·')); assert.eq([EXTENDNUMLET, MIDNUMLET, MIDNUM, MIDNUM, MIDNUM, EXTENDNUMLET, EXTENDNUMLET], classify('=-+*/??')); assert.eq([CR], classify('\r')); assert.eq([EXTEND], classify('?')); assert.eq([NEWLINE], classify('\x0B')); assert.eq([FORMAT], classify('?')); assert.eq([EXTENDNUMLET], classify('?')); assert.eq([AT], classify('@')); }; testClassify(); } );