   (with-temp-buffer
     (rust-mode)
     (insert str)
-    (font-lock-fontify-buffer)
+    (font-lock-ensure)
     (buffer-string)))
 
 (defun rust-test-group-str-by-face (str)

          (with-temp-buffer
            (rust-mode)
            (insert original)
            (font-lock-fontify-buffer)

            (goto-char point-pos)
            (deactivate-mark)

(ert-deftest rust-test-two-character-quotes-in-a-row ()
  (with-temp-buffer
    (rust-mode)
    (font-lock-ensure)
    (insert "'\\n','a', fn")
    (font-lock-after-change-function 1 12 0)

