Skip to content

Commit 7092964

Browse files
author
Danny McClanahan
committed
fix test failures
1 parent 83f1043 commit 7092964

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

markdown-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5947,7 +5947,8 @@ alive."
59475947
(funcall
59485948
markdown-live-preview-window-function out-file))))
59495949
(with-current-buffer view-buf
5950-
(add-hook #'markdown-live-preview-teardown-view t t))
5950+
(add-hook 'kill-buffer-hook
5951+
#'markdown-live-preview-teardown-view t t))
59515952
(markdown-live-preview-link-source-view-buffers
59525953
src-buf view-buf)
59535954
(with-current-buffer src-buf

tests/markdown-test.el

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3755,48 +3755,46 @@ Detail: https://github.com/jrblevin/markdown-mode/issues/79"
37553755
(let ((markdown-live-preview-idle-delay .01))
37563756
(markdown-temp-eww
37573757
(markdown-live-preview-mode)
3758-
(sit-for (+ markdown-live-preview-idle-delay .01))
3758+
(sit-for (* markdown-live-preview-idle-delay 3))
37593759
(accept-process-output)
37603760
(should (buffer-live-p markdown-live-preview-view-buffer))
37613761
(should (eq (current-buffer)
37623762
(with-current-buffer markdown-live-preview-view-buffer
37633763
markdown-live-preview-source-buffer)))
37643764
(kill-buffer markdown-live-preview-view-buffer)
37653765
(should (null markdown-live-preview-view-buffer))
3766-
(set-buffer-modified-p t)
3767-
;; below should create new export
3768-
(sit-for (+ markdown-live-preview-idle-delay .01))
3766+
(markdown-live-preview-async-export)
3767+
(sit-for (* markdown-live-preview-idle-delay 3))
3768+
(accept-process-output)
37693769
(should (buffer-live-p markdown-live-preview-view-buffer))))))
37703770

37713771
(ert-deftest test-markdown-ext/live-preview-delete-exports ()
3772-
(let ((markdown-live-preview-idle-delay .01))
3772+
(let ((markdown-live-preview-idle-delay .01)
3773+
file-output)
37733774
(markdown-temp-eww
3774-
(let ((markdown-live-preview-delete-export 'delete-on-destroy)
3775-
file-output)
3775+
(let ((markdown-live-preview-delete-export 'delete-on-destroy))
37763776
(markdown-test-temp-file "inline.text"
37773777
(markdown-live-preview-mode)
3778-
(sit-for (+ markdown-live-preview-idle-delay .01))
3778+
(sit-for (* markdown-live-preview-idle-delay 3))
37793779
(accept-process-output)
37803780
(setq file-output (markdown-export-file-name)))
37813781
(should-not (file-exists-p file-output)))
3782-
(let ((markdown-live-preview-delete-export 'delete-on-export)
3783-
file-output)
3782+
(let ((markdown-live-preview-delete-export 'delete-on-export))
37843783
(markdown-test-temp-file "inline.text"
37853784
(markdown-live-preview-mode)
3786-
(sit-for (+ markdown-live-preview-idle-delay .01))
3785+
(sit-for (* markdown-live-preview-idle-delay 3))
37873786
(accept-process-output)
37883787
(setq file-output (markdown-export-file-name))
37893788
(should-not (file-exists-p file-output))))
3790-
(let ((markdown-live-preview-delete-export nil)
3791-
file-output)
3792-
(unwind-protect
3793-
(markdown-test-temp-file "inline.text"
3794-
(markdown-live-preview-mode)
3795-
(sit-for (+ markdown-live-preview-idle-delay .01))
3796-
(accept-process-output)
3797-
(setq file-output (markdown-export-file-name))
3798-
(should (file-exists-p file-output)))
3799-
(delete-file file-output))))))
3789+
(unwind-protect
3790+
(markdown-test-temp-file "inline.text"
3791+
(markdown-live-preview-mode)
3792+
(sit-for (* markdown-live-preview-idle-delay 3))
3793+
(accept-process-output)
3794+
(setq file-output (markdown-export-file-name))
3795+
(setq markdown-live-preview-delete-export nil)
3796+
(should (file-exists-p file-output)))
3797+
(delete-file file-output)))))
38003798

38013799
(provide 'markdown-test)
38023800

0 commit comments

Comments
 (0)