mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Add specs for truthiness of marker position assignment return values
This commit is contained in:
@@ -713,6 +713,13 @@ describe 'Buffer', ->
|
||||
expect(buffer.getMarkerRange(marker)).toEqual [[2, 0], [4, 23]]
|
||||
expect(buffer.isMarkerReversed(marker)).toBeTruthy()
|
||||
|
||||
it "returns whether the position changed", ->
|
||||
expect(buffer.setMarkerHeadPosition(marker, [5, 3])).toBeTruthy()
|
||||
expect(buffer.setMarkerHeadPosition(marker, [5, 3])).toBeFalsy()
|
||||
|
||||
expect(buffer.setMarkerTailPosition(marker, [6, 3])).toBeTruthy()
|
||||
expect(buffer.setMarkerTailPosition(marker, [6, 3])).toBeFalsy()
|
||||
|
||||
describe ".observeMarker(marker, callback)", ->
|
||||
[observeHandler, marker, subscription] = []
|
||||
|
||||
|
||||
@@ -613,6 +613,17 @@ describe "DisplayBuffer", ->
|
||||
expect(displayBuffer.isMarkerReversed(marker)).toBeTruthy()
|
||||
expect(displayBuffer.getMarkerBufferRange(marker)).toEqual [[5, 4], [8, 4]]
|
||||
|
||||
it "returns whether a position changed when it is assigned", ->
|
||||
marker = displayBuffer.markScreenRange([[0, 0], [0, 0]])
|
||||
expect(displayBuffer.setMarkerHeadScreenPosition(marker, [5, 4])).toBeTruthy()
|
||||
expect(displayBuffer.setMarkerHeadScreenPosition(marker, [5, 4])).toBeFalsy()
|
||||
expect(displayBuffer.setMarkerHeadBufferPosition(marker, [1, 0])).toBeTruthy()
|
||||
expect(displayBuffer.setMarkerHeadBufferPosition(marker, [1, 0])).toBeFalsy()
|
||||
expect(displayBuffer.setMarkerTailScreenPosition(marker, [5, 4])).toBeTruthy()
|
||||
expect(displayBuffer.setMarkerTailScreenPosition(marker, [5, 4])).toBeFalsy()
|
||||
expect(displayBuffer.setMarkerTailBufferPosition(marker, [1, 0])).toBeTruthy()
|
||||
expect(displayBuffer.setMarkerTailBufferPosition(marker, [1, 0])).toBeFalsy()
|
||||
|
||||
describe ".observeMarker(marker, callback)", ->
|
||||
[observeHandler, marker, subscription] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user