    (lambda ()
      (find-file-and-wait-for-project-load "test/Test1/Program.fs")
      (search-forward "X.func")
-     (delete-backward-char 2)
+     (delete-char -2)
      (auto-complete)
      (ac-complete)
      (beginning-of-line)

   (lambda ()
     (find-file-and-wait-for-project-load "test/Test1/Program.fs")
     (search-forward "X.func")
     (delete-backward-char 1)
     (backward-char)
     (fsharp-ac-parse-current-buffer t)
     (wait-for-condition (lambda () (> (length (overlays-at (point))) 0)))

     (wait-for-condition (lambda () (/= (point) 88)))
     (should= (point) 18)
     (fsharp-ac/pop-gotodefn-stack)
     (should= (point) 88)
     ;; across files
     (goto-char (point-min))
     (search-forward "NewObjectType()")
     (backward-char 7)
     (fsharp-ac/gotodefn-at-point)
     (wait-for-condition
      (lambda () (progn
              ;; Command loop doesn't get executed so the buffer change
              ;; in the filter function doesn't take effect. Prod it manually.
              (set-buffer (window-buffer (selected-window)))
              (and (/= (point) 64)
                   (equal (buffer-name) "FileTwo.fs")))))
     (should= (buffer-name) "FileTwo.fs")
     (should= (point) 97)
     (fsharp-ac/pop-gotodefn-stack)
     (should= (buffer-name) "Program.fs")
     (should= (point) 64))))

(ert-deftest check-tooltip ()
  "Check tooltip request works"
