Emacs library to facilitate the creation of tabulated-list based UIs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.8KB

  1. ;;; navigel-test.el --- Tests for navigel.el -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 2019 Damien Cassou
  3. ;; Author: Damien Cassou <damien@cassou.me>
  4. ;; This program is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. ;;; Commentary:
  15. ;; Tests for navigel.el.
  16. ;;; Code:
  17. (require 'navigel)
  18. (require 'ert)
  19. (require 'cl-lib)
  20. (ert-deftest navigel-insert-context-in-args ()
  21. (progn
  22. ;; no arguments:
  23. (should (equal
  24. (navigel--insert-context-in-args 'foo '())
  25. '(&context (navigel-app foo))))
  26. ;; only mandatory arguments:
  27. (should (equal
  28. (navigel--insert-context-in-args 'foo '(a))
  29. '(a &context (navigel-app foo))))
  30. ;; special argument:
  31. (should (equal
  32. (navigel--insert-context-in-args 'foo '(a &optional b))
  33. '(a &context (navigel-app foo) &optional b)))
  34. ;; context argument:
  35. (should (equal
  36. (navigel--insert-context-in-args 'foo '(a &context (a b)))
  37. '(a &context (navigel-app foo) (a b))))
  38. ;; special + context argument:
  39. (should (equal
  40. (navigel--insert-context-in-args 'foo '(a &context (a b) &optional b))
  41. '(a &context (navigel-app foo) (a b) &optional b)))))
  42. (provide 'navigel-test)
  43. ;;; navigel-test.el ends here