~subsetpark/fugue

ref: 3b9b508f647281a2eaea409e2fdc37a974406780 fugue/test/namespaces.janet -rw-r--r-- 571 bytes
3b9b508f — Zach Smith Add test case for fugue/#4 7 months ago
                                                                                
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
(use testament)
(import /fugue)

(import /test-support/a)
(import /test-support/b)

(deftest multiple-file-multi-extend 
  (is (= 11 (a/f 10))))

(deftest namespaced-allocations
  (let [a-b (:new b/B)]
    (fugue/allocate a-b :base-attr "base")
    (fugue/allocate a-b :child-attr "child")
    (is (= (a/A :base-attr) "base"))
    (is (= (a-b :base-attr) "base"))

    (is (= (b/B :child-attr) "child"))
    (is (= (a-b :child-attr) "child"))))

(deftest overlapping-defmultis
  (is (= "ok!" (a/g "ok")))
  (is (thrown? (b/g "ok")))
  (is (= 12 (b/g 10))))

(run-tests!)