Sfoglia il codice sorgente

Define range intersection of collapsed ranges.

Maciej Gołaszewski 5 anni fa
parent
commit
d7a306b372
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      packages/ckeditor5-engine/tests/model/range.js

+ 7 - 0
packages/ckeditor5-engine/tests/model/range.js

@@ -156,6 +156,13 @@ describe( 'Range', () => {
 			const otherRange = new Range( new Position( otherRoot, [ 0 ] ), new Position( otherRoot, [ 1, 4 ] ) );
 			expect( range.isIntersecting( otherRange ) ).to.be.false;
 		} );
+
+		it( 'should return false if ranges are collapsed and equal', () => {
+			range = new Range( new Position( root, [ 1, 1 ] ) );
+			const otherRange = new Range( new Position( otherRoot, [ 1, 1 ] ) );
+
+			expect( range.isIntersecting( otherRange ) ).to.be.false;
+		} );
 	} );
 
 	describe( 'static constructors', () => {