PageRenderTime 50ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/elisp/omake/omake-error-test.el

https://bitbucket.org/yminsky/js-elisp
Emacs Lisp | 33 lines | 27 code | 3 blank | 3 comment | 0 complexity | bd017a3d65f68e875e6546546b50dcec MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-3.0, Apache-2.0, GPL-3.0, LGPL-2.0
  1. ;; -*- lexical-binding: nil -*-
  2. (require 'ert)
  3. (require 'omake-error)
  4. (ert-deftest Omake.Error ()
  5. (let* (;; Need \\\ so string lengths are the same.
  6. (e1-text "File \\\"test.ml\\\", line 9, characters 6-7:\nWarning 27: \
  7. unused variable z.")
  8. (e1 (Omake.Error.test-error e1-text))
  9. (table (make-hash-table :test 'Omake.Error.hash-test))
  10. (e1-val 1)
  11. (sbs (Omake.Error.to-status-buffer-string e1))
  12. (_ (puthash e1 e1-val table)))
  13. (should (Omake.Error.is e1))
  14. (should (Omake.Error.same-error e1 e1))
  15. (should (Omake.Error.hash e1))
  16. (should (equal (gethash e1 table) e1-val))
  17. (should (equal sbs e1-text))
  18. ;; mem
  19. (should (Omake.Error.mem e1 (list e1 e1 e1)))
  20. ;; toggle/contract/expand
  21. (should-not (Omake.Error.full-text-visible-p e1))
  22. (Omake.Error.toggle-full-text e1)
  23. (should (Omake.Error.full-text-visible-p e1))
  24. (Omake.Error.contract e1)
  25. (should-not (Omake.Error.full-text-visible-p e1))
  26. (Omake.Error.expand e1)
  27. (should (Omake.Error.full-text-visible-p e1))
  28. (should-not (Omake.Error.string e1))
  29. (should-not (Omake.Error.full-string e1))))
  30. (provide 'omake-error-test)