#50 Added (failing) unit test for unicode support

This commit is contained in:
Carlo Sciolla 2016-12-25 19:14:32 +01:00
parent f8148e9d5f
commit 06a12c3d16
No known key found for this signature in database
GPG Key ID: BA5D71E6F3C580C1
5 changed files with 19 additions and 3 deletions

View File

@ -8,15 +8,18 @@
;;; Code:
(defun assert-preview (puml output)
(defun assert-preview (puml output &optional format)
(unless format (setq-local plantuml-output-type "utxt"))
(plantuml-preview-string 42 (read-test-file puml))
(sleep-for 2)
(sleep-for 3)
(should (equal (read-test-file output) (read-preview-buffer))))
(ert-deftest preview-test ()
(setq-local plantuml-jar-path plantuml-test-jar-path)
(setq-local plantuml-output-type "utxt")
(assert-preview "a-b.puml" "a-b.txt"))
(assert-preview "a-b.puml" "a-b.txt")
(assert-preview "unicode.puml" "unicode.txt"))
(provide 'plantuml-mode-preview-test)

BIN
test/resources/a-b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
test/resources/unicode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,5 @@
@startuml
lang -> 日本語
@enduml

View File

@ -0,0 +1,8 @@
┌────┐ ┌──────┐
│lang│ │日本語│
└──┬─┘ └───┬──┘
│ │
│────────-----──>│
┌──┴─┐ ┌───┴──┐
│lang│ │日本語│
└────┘ └──────┘