-
Notifications
You must be signed in to change notification settings - Fork 28
/
test-e2wm-pst-class.el
40 lines (34 loc) · 1.2 KB
/
test-e2wm-pst-class.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;; How to run:
;; emacs -batch \
;; -L PATH/TO/E2WM/ \
;; -L PATH/TO/WINDOW-LAYOUT/ \
;; -l PATH/TO/test-e2wm-pst-class.el \
;; -f ert-run-tests-batch-and-exit
(require 'ert)
(require 'e2wm)
(ert-deftest e2wm-pst-class-simple-inheritance ()
(let* ((expected-result 1)
(super-class
(make-e2wm:$pst-class :init (lambda () expected-result)))
(class
(make-e2wm:$pst-class
:extend super-class
:init (lambda () (e2wm:$pst-class-super))))
(result (e2wm:method-call
#'e2wm:$pst-class-init class nil)))
(should (equal result expected-result))))
(ert-deftest e2wm-pst-class-grandchild ()
(let* ((expected-result 1)
(grand-class
(make-e2wm:$pst-class :init (lambda () expected-result)))
(super-class
(make-e2wm:$pst-class
:extend grand-class
:init (lambda () (e2wm:$pst-class-super))))
(class
(make-e2wm:$pst-class
:extend super-class
:init (lambda () (e2wm:$pst-class-super))))
(result (e2wm:method-call
#'e2wm:$pst-class-init class nil)))
(should (equal result expected-result))))