           expect(region2.width()).toBe(editor.renderedLines.width())
 
           region3 = selectionView.regions[2]
-          expect(region3.position().top).toBe(6 * lineHeight)
-          expect(region3.position().left).toBe(0)
-          expect(region3.height()).toBe lineHeight
-          expect(region3.width()).toBe(25 * charWidth)
+          expect(region3.position().top).toBeCloseTo(6 * lineHeight)
+          expect(region3.position().left).toBeCloseTo(0)
+          expect(region3.height()).toBeCloseTo lineHeight
+          expect(region3.width()).toBeCloseTo(25 * charWidth)
 
       it "clears previously drawn regions before creating new ones", ->
         selection.setBufferRange(new Range({row: 2, column: 7}, {row: 4, column: 25}))

          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)

          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())

          # resizes with the editor
          expect(editor.width()).toBeLessThan(800)


          expect(selectionView.regions.length).toBe 1
          region = selectionView.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 the selection spans 2 lines", ->
        it "covers the selection's range with 2 regions", ->
