   (declare (indent 1))
   `(ert-deftest
        ,(intern (replace-regexp-in-string "[ .]" "-" desc)) ()
-     (in-ns fsharp-doc
-       ,@body)))
+     ,@body))
+
+(defun should-match (regex str)
+  (should (string-match-p regex str)))
 
 ;;; ----------------------------------------------------------------------------
 ;;; Test data

(provide 'fsharp-doc-tests)
(require 'ert)

(defmacro check (desc &rest body)

;;; ----------------------------------------------------------------------------
;;; Tests

(defun parse-into-lines (str)
  (split-string (fsharp-doc/format-for-minibuffer str) "[\n\r]"))

;;; Vals

(check "parsed val should be a single line"
  (let ((lines (parse-into-lines val-tooltip)))
    (should (= 1 (length lines)))))

(check "parsed val should start with 'val'"
  (should-match "^val" (fsharp-doc/format-for-minibuffer val-tooltip)))

(check "parsed val should contain type signature"
  (should-match ": x:'a -> b$" (fsharp-doc/format-for-minibuffer val-tooltip)))

(check "parsed val should be module-qualified"
  (should-match "^val Modid.id" (fsharp-doc/format-for-minibuffer val-tooltip)))

;;; Types

(check "parsed type should be a single line"
  (let ((lines (parse-into-lines type-tooltip)))
    (should (= 1 (length lines)))))

(check "parsed type should start with 'type'"
  (should-match "^type" (fsharp-doc/format-for-minibuffer type-tooltip)))

(check "type identifier should be module-qualified"
  (should-match "^type Modid.id" (fsharp-doc/format-for-minibuffer type-tooltip)))

;;; Properties

(check "parsed property should be a single line"
  (let ((lines (parse-into-lines property-tooltip)))
    (should (= 1 (length lines)))))

(check "parsed property should start with 'property'"
  (should-match "^property" (fsharp-doc/format-for-minibuffer property-tooltip)))

(check "parsed property should end with type"
  (should-match ": a$" (fsharp-doc/format-for-minibuffer property-tooltip)))

(check "property identifier should be qualified"
  (should-match "^property Modid.id" (fsharp-doc/format-for-minibuffer property-tooltip)))

;;; Objects

(check "parsed object should be a single line"
  (let ((lines (parse-into-lines object-tooltip)))
    (should (= 1 (length lines)))))

(check "parsed object should start with 'type'"
  (should-match "^type" (fsharp-doc/format-for-minibuffer object-tooltip)))

(check "parsed object should be fully qualified"
  (should-match "^type Modid.id" (fsharp-doc/format-for-minibuffer object-tooltip)))
