This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from ckeditor/t/269
Other: Optimized `diff()` function to use `fastDiff()` function internally for large data sets. Closes #269.
- Loading branch information
Showing
10 changed files
with
792 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
import getLongText from '../../tests/_utils/longtext'; | ||
|
||
describe( 'utils', () => { | ||
describe( 'getLongText', () => { | ||
it( 'should return text with 0 length', () => { | ||
expect( getLongText( 0 ).length ).to.equal( 0 ); | ||
} ); | ||
|
||
it( 'should return text with 553 length', () => { | ||
expect( getLongText( 553 ).length ).to.equal( 553 ); | ||
} ); | ||
|
||
it( 'should return text with 1500 length', () => { | ||
expect( getLongText( 1500 ).length ).to.equal( 1500 ); | ||
} ); | ||
|
||
it( 'should return text with 4000 length', () => { | ||
expect( getLongText( 4000 ).length ).to.equal( 4000 ); | ||
} ); | ||
|
||
it( 'should return different text with fromStart=false', () => { | ||
expect( getLongText( 100 ) ).to.not.equal( getLongText( 100, false ) ); | ||
} ); | ||
|
||
it( 'should return reversed text', () => { | ||
const text1 = getLongText( 100 ); | ||
const text2 = getLongText( 100, true, true ); | ||
|
||
expect( text1 ).to.not.equal( text2 ); | ||
expect( text1 ).to.equal( text2.split( '' ).reverse().join( '' ) ); | ||
} ); | ||
|
||
it( 'should return reversed text (with fromStart=false)', () => { | ||
const text1 = getLongText( 150, false ); | ||
const text2 = getLongText( 150, false, true ); | ||
|
||
expect( text1 ).to.not.equal( text2 ); | ||
expect( text1 ).to.equal( text2.split( '' ).reverse().join( '' ) ); | ||
} ); | ||
} ); | ||
} ); |
Oops, something went wrong.