~subsetpark/fugue

670edce651133648fbc0213177fb40d68dc439a6 — Zach Smith a month ago 469ef4a
test namespaced allocation
3 files changed, 14 insertions(+), 0 deletions(-)

M test-support/a.janet
M test-support/b.janet
M test/fugue.janet
M test-support/a.janet => test-support/a.janet +2 -0
@@ 1,2 1,4 @@
(use /fugue)
(declare-open-multi f)

(defproto A nil base-attr {:allocation :prototype})

M test-support/b.janet => test-support/b.janet +2 -0
@@ 2,3 2,5 @@
(import /test-support/a)

(extend-multi a/f [:number] [n] (inc n))

(defproto B a/A child-attr {:allocation :prototype})

M test/fugue.janet => test/fugue.janet +10 -0
@@ 349,6 349,16 @@
(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"))))

(fugue/defproto SlotHaver () name {})

(deftest slots-test