           expect(selectionView.regions.length).toBe 3
 
           region1 = selectionView.regions[0]
-          expect(region1.position().top).toBe(2 * lineHeight)
-          expect(region1.position().left).toBe(7 * charWidth)
-          expect(region1.height()).toBe lineHeight
-          expect(region1.width()).toBe(editor.renderedLines.width() - region1.position().left)
+          expect(region1.position().top).toBeCloseTo(2 * lineHeight)
+          expect(region1.position().left).toBeCloseTo(7 * charWidth)
+          expect(region1.height()).toBeCloseTo lineHeight
+          expect(region1.width()).toBeCloseTo(editor.renderedLines.width() - region1.position().left)
 
           region2 = selectionView.regions[1]
-          expect(region2.position().top).toBe(3 * lineHeight)
-          expect(region2.position().left).toBe(0)
-          expect(region2.height()).toBe(3 * lineHeight)
-          expect(region2.width()).toBe(editor.renderedLines.width())
+          expect(region2.position().top).toBeCloseTo(3 * lineHeight)
+          expect(region2.position().left).toBeCloseTo(0)
+          expect(region2.height()).toBeCloseTo(3 * lineHeight)
+          expect(region2.width()).toBeCloseTo(editor.renderedLines.width())
 
           # resizes with the editor
           expect(editor.width()).toBeLessThan(800)

          expect(selectionView.regions.length).toBe 2

          region1 = selectionView.regions[0]
          expect(region1.position().top).toBe(2 * lineHeight)
          expect(region1.position().left).toBe(7 * charWidth)
          expect(region1.height()).toBe lineHeight
          expect(region1.width()).toBe(editor.renderedLines.width() - region1.position().left)

          region2 = selectionView.regions[1]
          expect(region2.position().top).toBe(3 * lineHeight)
          expect(region2.position().left).toBe(0)
          expect(region2.height()).toBe lineHeight
          expect(region2.width()).toBe(25 * charWidth)

      describe "when the selection spans more than 2 lines", ->
        it "covers the selection's range with 3 regions", ->

        expect(selectionViews.length).toBe 2
        expect(selectionViews[1].regions.length).toBe 1
        region = selectionViews[1].regions[0]
        expect(region.position().top).toBeCloseTo(2 * lineHeight)
        expect(region.position().left).toBeCloseTo(7 * charWidth)
        expect(region.height()).toBeCloseTo lineHeight
        expect(region.width()).toBeCloseTo((25 - 7) * charWidth)

    describe "when a selection changes", ->
      describe "when the selection is within a single line", ->
