mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 16:09:57 +03:00
6bf82a27c9
Still a lot of details to cover, but basic selection creation is working.
18 lines
606 B
CoffeeScript
18 lines
606 B
CoffeeScript
Range = require 'range'
|
|
Point = require 'point'
|
|
|
|
describe "Range", ->
|
|
describe "constructor", ->
|
|
it "ensures that @start <= @end", ->
|
|
range1 = new Range(new Point(0, 1), new Point(0, 4))
|
|
expect(range1.start).toEqual(row: 0, column: 1)
|
|
|
|
range2 = new Range(new Point(1, 4), new Point(0, 1))
|
|
expect(range2.start).toEqual(row: 0, column: 1)
|
|
|
|
describe ".isEmpty()", ->
|
|
it "returns true if @start equals @end", ->
|
|
expect(new Range(new Point(1, 1), new Point(1, 1)).isEmpty()).toBeTruthy()
|
|
expect(new Range(new Point(1, 1), new Point(1, 2)).isEmpty()).toBeFalsy()
|
|
|