initial working article browser based on new nemas-given... functions
[arxana.git] / elisp / honey-demo-ert.el
blob93ea7134e56c429000a34f5e7a7037ec3b8c4348
1 (load-file "honey-redux.el")
3 (ert-deftest honey-demo-tests ()
4 (should
5 (equal
6 (car (set-current-plexus (add-plexus)))
7 '*plexus*))
8 (should
9 (equal
10 (add-nema 0 0 "walrus")
11 2))
12 (should
13 (equal
14 (add-nema 0 0 "mammal")
15 3))
16 (should
17 (equal
18 (add-nema 2 3 nil)
19 4))
20 (should
21 (equal
22 (label-nema 2 "walrus")
23 2))
24 (should
25 (equal
26 (label-nema 3 "mammal")
27 3))
28 (should
29 (equal
30 (label2uid "mammal")
31 3))
32 (should
33 (equal
34 (uid2label 2)
35 "walrus"))
36 (should
37 (equal
38 (get-content 2)
39 "walrus"))
40 (should
41 (equal
42 (get-source 4)
43 2))
44 (should
45 (equal
46 (get-sink 4)
47 3))
48 (should
49 (equal
50 (uid2label (get-sink 4))
51 "mammal"))
52 (should
53 (equal
54 (get-content (label2uid "walrus"))
55 "walrus"))
56 (should
57 (equal
58 (setq simple-example (download-en-masse))
59 '((0 "ground" 0 0)
60 (1 "type" 0 0)
61 (2 "walrus" 0 0 . "walrus")
62 (3 "mammal" 0 0 . "mammal")
63 (4 nil 2 3))))
64 (should
65 (equal
66 (reset-plexus)
67 nil))
68 (should
69 (equal
70 (download-en-masse)
71 '((0 "ground" 0 0)
72 (1 "nema-type" 0 0))))
73 (should
74 (equal
75 (upload-en-masse simple-example)
76 t))
77 (should
78 (equal
79 (uid2label (get-source 4))
80 "walrus"))
81 (should
82 (equal
83 simple-example
84 (download-en-masse)))
85 (should
86 (equal
87 (label-nema
88 (add-nema (label2uid "type")
89 (label2uid "ground")
90 nil)
91 "isa-type")
92 5))
93 (should
94 (equal
95 (label-nema
96 (add-nema (label2uid "type")
97 (label2uid "ground")
98 nil)
99 "thing-type")
101 (should
102 (equal
103 (uid2label (get-source 5))
104 "type"))
105 (should
106 (equal
107 (uid2label (get-sink 5))
108 "ground"))
109 (should
110 (equal
111 (remove-nema 5)
112 nil))
113 (should
114 (equal
115 (label-nema
116 (add-nema (label2uid "ground")
117 (label2uid "type")
118 "isa")
119 "isa-type")
121 (should
122 (equal
123 (update-source 6 (label2uid "ground"))
124 '((6 . 0)(7 . 0))))
125 (should
126 (equal
127 (update-sink 6 (label2uid "type"))
128 '((6 . 1))))
129 (should
130 (equal
131 (update-content 6 "thing")
132 '(0 1 . "thing")))
133 (should
134 (equal
135 (add-nema (label2uid "thing-type")
136 (label2uid "walrus")
137 nil)
139 (should
140 (equal
141 (add-nema (label2uid "thing-type")
142 (label2uid "mammal")
143 nil)
145 (should
146 (equal
147 (add-nema (label2uid "isa-type")
149 nil)
150 10)))