   (let [env (interpret (parse "items is a list\nitems add 'sword'")
                        (library/get-initial-env extra-types))]
     (is (= (resolve- {:ref "items"} env) #{"sword"}))))
+
+(deftest test-add-obj-to-list-works-with-ref
+  (let [env (interpret (parse "items is a list\nmary is a person\nitems add mary")
+                       (library/get-initial-env extra-types))]
+    (is (= (get (:ctx env) "items") #{{:ref "mary"}}))))
 
 (deftest test-add-duplicate-item-does-nothing-string
   (let [env (interpret (parse "items is a list\nitems add 'sword'\nitems add 'sword'")

           (new isla.test.interpreter.Person 0
                ""
                (new isla.test.interpreter.Person 0 "" :undefined))))))

;; test extract fn


                       (library/get-initial-env extra-types))]
    (is (= (resolve- {:ref "items"} env) #{}))))

(deftest test-unknown-scalar-list-add-causes-exception
  (try
    (interpret (parse "items add 'sword'")
               (library/get-initial-env extra-types))
    (is false) ;; should not get called
    (catch Exception e
      (is (= (.getMessage e) "I do not know of a list called items.")))))

(deftest test-unknown-object-attr-list-add-causes-exception
  (try
    (interpret (parse "isla items add 1")
               (library/get-initial-env extra-types))
    (is false) ;; should not get called
    (catch Exception e
      (is (= (.getMessage e) "I do not know of a list called isla items.")))))

;; list addition

