                   completions))
     (should (= start-col 7))))
 
-(ycmd-ert-test-deferred-request goto-declaration "test-goto.cpp" 'c++-mode
+(ycmd-ert-deftest-deferred-request goto-declaration "test-goto.cpp" 'c++-mode
   :request-func (apply-partially #'ycmd--send-completer-command-request
                                  "GoToDeclaration")
   :line 9 :column 7

(require 'company-ycmd)
(require 'flycheck-ert)
(require 'flycheck-ycmd)

(defconst ycmd-test-location
  (file-name-directory (or load-file-name buffer-file-name)))

          (set-visited-file-name nil 'no-query)
          (string= actual expected))))))

(defmacro ycmd-ert-deftest-fixit (name mode &rest keys)
  (declare (indent 2) (debug t))
  (let* ((line (plist-get keys :line))
         (column (plist-get keys :column)))
    (macroexpand
     `(ycmd-ert-deftest-deferred-request
          ,name ,(plist-get keys :filename) ,mode
        :request-func
        (apply-partially #'ycmd--send-completer-command-request
                         "FixIt")
        :line ,line :column ,column
        (should
         (ycmd-test-fixit-handler
          buff response ,(plist-get keys :filename-expected)))))))

(ycmd-ert-deftest-fixit fixit-cpp-insert1 'c++-mode
  :filename "test-fixit-cpp11-insert1.cpp"
  :filename-expected "test-fixit-cpp11-insert1-expected.cpp"
  :line 7 :column 6)

(ycmd-ert-deftest-fixit fixit-cpp-insert2 'c++-mode
  :filename "test-fixit-cpp11-insert2.cpp"
  :filename-expected "test-fixit-cpp11-insert2-expected.cpp"
  :line 7 :column 5)

(ycmd-ert-deftest-fixit fixit-cpp-delete 'c++-mode
  :filename "test-fixit-cpp11-delete.cpp"
  :filename-expected "test-fixit-cpp11-delete-expected.cpp"
  :line 1 :column 6)

(ycmd-ert-deftest-fixit fixit-cpp-replace 'c++-mode
  :filename "test-fixit-cpp11-replace.cpp"
  :filename-expected "test-fixit-cpp11-replace-expected.cpp"
  :line 3 :column 6)

(ycmd-ert-deftest-fixit fixit-cpp-delete-add 'c++-mode
  :filename "test-fixit-cpp11-delete-add.cpp"
  :filename-expected "test-fixit-cpp11-delete-add-expected.cpp"
  :line 5 :column 3)

(ycmd-ert-deftest-fixit fixit-cpp-multiple 'c++-mode
  :filename "test-fixit-cpp11-multiple.cpp"
  :filename-expected "test-fixit-cpp11-multiple-expected.cpp"
  :line 2 :column 15)

(defmacro ycmd-test-with-buffer (filename mode &rest body)
  "Create temporary current buffer with FILENAME and MODE and execute BODY."
