PHP Classes

File: public/js/tinymce/src/core/src/test/js/browser/undo/DiffTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/core/src/test/js/browser/undo/DiffTest.js   Download  
File: public/js/tinymce/src/core/src/test/js/browser/undo/DiffTest.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,202 bytes
 

Contents

Class file image Download
asynctest( 'browser.tinymce.core.undo.DiffTest', [ 'ephox.mcagar.api.LegacyUnit', 'ephox.agar.api.Pipeline', 'tinymce.core.undo.Diff' ], function (LegacyUnit, Pipeline, Diff) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; var suite = LegacyUnit.createSuite(); var KEEP = Diff.KEEP, INSERT = Diff.INSERT, DELETE = Diff.DELETE; suite.test('diff', function () { LegacyUnit.deepEqual(Diff.diff([], []), []); LegacyUnit.deepEqual(Diff.diff([1], []), [[DELETE, 1]]); LegacyUnit.deepEqual(Diff.diff([1, 2], []), [[DELETE, 1], [DELETE, 2]]); LegacyUnit.deepEqual(Diff.diff([], [1]), [[INSERT, 1]]); LegacyUnit.deepEqual(Diff.diff([], [1, 2]), [[INSERT, 1], [INSERT, 2]]); LegacyUnit.deepEqual(Diff.diff([1], [1]), [[KEEP, 1]]); LegacyUnit.deepEqual(Diff.diff([1, 2], [1, 2]), [[KEEP, 1], [KEEP, 2]]); LegacyUnit.deepEqual(Diff.diff([1], [2]), [[INSERT, 2], [DELETE, 1]]); LegacyUnit.deepEqual(Diff.diff([1], [2, 3]), [[INSERT, 2], [INSERT, 3], [DELETE, 1]]); }); Pipeline.async({}, suite.toSteps({}), function () { success(); }, failure); } );