-
Notifications
You must be signed in to change notification settings - Fork 12
/
daemons-openrc-test.el
23 lines (21 loc) · 1 KB
/
daemons-openrc-test.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(load-file "./daemons-openrc.el")
(ert-deftest openrc-parse-list-item-test ()
(let ((input " dummy | boot default nonetwork shutdown sysinit ")
(expected '("dummy" ["dummy" "boot" "default" "nonetwork" "shutdown" "sysinit"])))
(should (equal expected
(daemons-openrc--parse-list-item input)))))
(ert-deftest openrc-list-test ()
(let* ((dummy-output "
dummy1 | boot
dummy2 | default
dummy3 | nonetwork
dummy4 | shutdown
dummy5 | sysinit ")
(daemons--shell-command-to-string-fun (lambda (_) dummy-output))
(expected '(("dummy1" ["dummy1" "boot" "" "" "" ""])
("dummy2" ["dummy2" "" "default" "" "" ""])
("dummy3" ["dummy3" "" "" "nonetwork" "" ""])
("dummy4" ["dummy4" "" "" "" "shutdown" ""])
("dummy5" ["dummy5" "" "" "" "" "sysinit"]))))
(should (equal expected
(daemons-openrc--list)))))