2016-11-11 12:53:41 +01:00
|
|
|
;;; plantuml-mode-preview-test.el --- PlantUML Mode preview tests -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;; Author: Carlo Sciolla (skuro)
|
|
|
|
;; Maintainer: Carlo Sciolla (skuro)
|
|
|
|
;; URL: https://github.com/skuro/plantuml-mode
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2016-12-25 19:14:32 +01:00
|
|
|
(defun assert-preview (puml output &optional format)
|
|
|
|
(unless format (setq-local plantuml-output-type "utxt"))
|
2016-12-25 18:29:48 +01:00
|
|
|
(plantuml-preview-string 42 (read-test-file puml))
|
2016-12-25 19:14:32 +01:00
|
|
|
(sleep-for 3)
|
2016-12-25 20:13:23 +01:00
|
|
|
(should (equal (replace-regexp-in-string " " "~" (read-test-file output))
|
|
|
|
(replace-regexp-in-string " " "~" (read-preview-buffer)))))
|
2016-12-25 18:29:48 +01:00
|
|
|
|
2016-12-25 20:28:40 +01:00
|
|
|
(ert-deftest preview-utxt-test ()
|
|
|
|
(setq-local plantuml-jar-path plantuml-test-jar-path)
|
|
|
|
(assert-preview "a-b.puml" "a-b.txt"))
|
|
|
|
|
|
|
|
(ert-deftest preview-unicode-test ()
|
2016-11-11 12:53:41 +01:00
|
|
|
(setq-local plantuml-jar-path plantuml-test-jar-path)
|
2016-12-25 19:14:32 +01:00
|
|
|
(assert-preview "unicode.puml" "unicode.txt"))
|
2016-11-11 12:53:41 +01:00
|
|
|
|
|
|
|
(provide 'plantuml-mode-preview-test)
|
|
|
|
|
|
|
|
;;; plantuml-mode-preview-test.el ends here
|