 (defun elfeed-test-generate-url ()
   "Generate a random URL."
   (let* ((tlds '(".com" ".net" ".org"))
-         (tld (nth (random* (length tlds)) tlds))
+         (tld (nth (elfeed-random* (length tlds)) tlds))
          (path (downcase (elfeed-test-generate-title nil 3))))
     (url-recreate-url
      (url-parse-make-urlobj

(remove-hook 'kill-emacs-hook 'elfeed-db-gc-safe)
(remove-hook 'kill-emacs-hook 'elfeed-db-save)

(defun elfeed-test-generate-letter (&optional multibyte)
  "Generate a single character from a-z or unicode."
  (cl-flet ((control-p (char)
              (or (<= char #x001F) (and (>= char #x007F) (<= char #x009F)))))
    (if multibyte
        (loop for char = (random* (1+ #x10FF))
              unless (control-p char) return char)
      (+ ?a (random* 26)))))

(defun* elfeed-test-random (n &optional (variance 1.0))
  "Generate a random integer around N, minimum of 1."
  (max 1 (floor (+ n (- (random* (* 1.0 variance n)) (* variance 0.5 n))))))

(defun* elfeed-test-generate-word (&optional multibyte (length 6))
  "Generate a word around LENGTH letters long."

     :id (cons feed-id link)
     :title (elfeed-test-generate-title)
     :link link
     :date (+ min-time (elfeed-random* duration))
     :tags (list 'unread)
     :feed-id feed-id)))

