           """
 
           editor.setCursorBufferPosition([0,0])
-          expect(editorView.underlayer.find('.bracket-matcher:visible').length).toBe 2
-          expect(editorView.underlayer.find('.bracket-matcher:first').position()).toEqual editor.pixelPositionForBufferPosition([0,1])
-          expect(editorView.underlayer.find('.bracket-matcher:last').position()).toEqual editor.pixelPositionForBufferPosition([3,2])
+          expectHighlights([0,1], [3,2])
 
           editor.setCursorBufferPosition([0,1])
-          expect(editorView.underlayer.find('.bracket-matcher:visible').length).toBe 2
-          expect(editorView.underlayer.find('.bracket-matcher:first').position()).toEqual editor.pixelPositionForBufferPosition([0,1])
-          expect(editorView.underlayer.find('.bracket-matcher:last').position()).toEqual editor.pixelPositionForBufferPosition([3,2])
+          expectHighlights([0,1], [3,2])
 
       describe "when on a closing tag", ->
         it "highlight the opening and closing tag", ->

          """

          editor.setCursorBufferPosition([3,0])
          expect(editorView.underlayer.find('.bracket-matcher:visible').length).toBe 2
          expect(editorView.underlayer.find('.bracket-matcher:first').position()).toEqual editor.pixelPositionForBufferPosition([3,2])
          expect(editorView.underlayer.find('.bracket-matcher:last').position()).toEqual editor.pixelPositionForBufferPosition([0,1])

          editor.setCursorBufferPosition([3,2])
          expect(editorView.underlayer.find('.bracket-matcher:visible').length).toBe 2
          expect(editorView.underlayer.find('.bracket-matcher:first').position()).toEqual editor.pixelPositionForBufferPosition([3,2])
          expect(editorView.underlayer.find('.bracket-matcher:last').position()).toEqual editor.pixelPositionForBufferPosition([0,1])

          buffer.setText """
            <test>

          """

          editor.setCursorBufferPosition([3,2])
          expectHighlights([3,2], [0,1])

          editor.setCursorBufferPosition([0,1])
          expectHighlights([0,1], [3,2])

      describe "when the tag has attributes", ->
        it "highlights the opening and closing tags", ->
