       text = suggestionListElement.removeEmptySnippets(text)
       snippets = suggestionListElement.findSnippets(text)
       text = suggestionListElement.removeSnippetsFromText(snippets, text)
-      matches = suggestionListElement.findCharacterMatches(text, replacementPrefix)
+      matches = suggestionListElement.findCharacterMatcheIndices(text, replacementPrefix)
       for i in [0...text.length]
         if truthyIndices.indexOf(i) isnt -1
-          expect(matches["#{i}"]).toBeTruthy()
+          expect(matches?[i]).toBeTruthy()
         else
-          expect(matches["#{i}"]).toBeFalsy()
+          expect(matches?[i]).toBeFalsy()
 
     it 'finds matches when no snippets exist', ->
       assertMatches('hello', '', [])

      html = suggestionListElement.getDisplayHTML(text, snippet, replacementPrefix)
      expect(html).toBe('<span class="character-match">t</span>ext(<span class="snippet-completion"><span class="character-match">a</span>b</span>, <span class="snippet-completion">cd</span>)')

    ffit 'replaces a snippet with escaped right braces', ->
      text = ''
      snippet = 'abc(${1:d}, ${2:e})f ${3:interface{\\}}'
      replacementPrefix = 'a'
      expect(suggestionListElement.getDisplayHTML(text, snippet, replacementPrefix)).toBe('<span class="character-match">a</span>bc(<span class="snippet-completion">d</span>, <span class="snippet-completion">e</span>)f <span class="snippet-completion">interface{}</span>')

    ffit 'replaces a snippet with escaped multiple right braces', ->
      text = ''
      snippet = 'abc(${1:d}, ${2:something{ok\\}}, ${3:e})f ${4:interface{\\}}'
      replacementPrefix = 'a'

      assertMatches('hello${0:world}', 'h', [0])
      assertMatches('hello${0:world}', 'hw', [0,5])
      assertMatches('hello${0:world}', 'hlw', [0,2,5])

  describe 'removeEmptySnippets', ->
    it 'removes an empty snippet group', ->
