/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
- ;; -*- lexical-binding: nil -*-
- (require 'ert)
- (require 'omake-error)
- (ert-deftest Omake.Error ()
- (let* (;; Need \\\ so string lengths are the same.
- (e1-text "File \\\"test.ml\\\", line 9, characters 6-7:\nWarning 27: \
- unused variable z.")
- (e1 (Omake.Error.test-error e1-text))
- (table (make-hash-table :test 'Omake.Error.hash-test))
- (e1-val 1)
- (sbs (Omake.Error.to-status-buffer-string e1))
- (_ (puthash e1 e1-val table)))
- (should (Omake.Error.is e1))
- (should (Omake.Error.same-error e1 e1))
- (should (Omake.Error.hash e1))
- (should (equal (gethash e1 table) e1-val))
- (should (equal sbs e1-text))
- ;; mem
- (should (Omake.Error.mem e1 (list e1 e1 e1)))
- ;; toggle/contract/expand
- (should-not (Omake.Error.full-text-visible-p e1))
- (Omake.Error.toggle-full-text e1)
- (should (Omake.Error.full-text-visible-p e1))
- (Omake.Error.contract e1)
- (should-not (Omake.Error.full-text-visible-p e1))
- (Omake.Error.expand e1)
- (should (Omake.Error.full-text-visible-p e1))
- (should-not (Omake.Error.string e1))
- (should-not (Omake.Error.full-string e1))))
- (provide 'omake-error-test)