diff --git a/src/test/java/com/github/jlangch/venice/impl/specialforms/SpecialFormsTest_var.java b/src/test/java/com/github/jlangch/venice/impl/specialforms/SpecialFormsTest_var.java index 92d63b223..302582cb6 100644 --- a/src/test/java/com/github/jlangch/venice/impl/specialforms/SpecialFormsTest_var.java +++ b/src/test/java/com/github/jlangch/venice/impl/specialforms/SpecialFormsTest_var.java @@ -60,6 +60,7 @@ public void test_var_ns() { @Test public void test_var_sym_meta() { + // def assertEquals(true, new Venice().eval("(do " + " (def ^:private x 100) " + " (:private (var-sym-meta 'x)))")); @@ -67,10 +68,27 @@ public void test_var_sym_meta() { assertEquals(3L, new Venice().eval("(do " + " (def ^{:foo 3} x 100) " + " (:foo (var-sym-meta 'x)))")); + + // let + assertEquals(3L, new Venice().eval("(do " + + " (let [^{:foo 3} x 100] " + + " (:foo (var-sym-meta 'x))))")); + + // binding + assertEquals(3L, new Venice().eval("(do " + + " (binding [^{:foo 3} x 100] " + + " (:foo (var-sym-meta 'x))))")); + + // function arg + assertEquals(3L, new Venice().eval("(do " + + " (defn bar [^{:foo 3} x] " + + " (:foo (var-sym-meta 'x))) " + + " (bar 100)) ")); } @Test public void test_var_val_meta() { + // def assertEquals(4L, new Venice().eval("(do " + " (def x (vary-meta 100 assoc :foo 4)) " + " (:foo (var-val-meta 'x))) ")); @@ -82,6 +100,22 @@ public void test_var_val_meta() { assertEquals(3L, new Venice().eval("(do " + " (def ^{:foo 3} x (vary-meta 100 assoc :bar 4)) " + " (:foo (var-sym-meta 'x))) ")); + + // let + assertEquals(3L, new Venice().eval("(do " + + " (let [x ^{:foo 3} 100] " + + " (:foo (var-val-meta 'x))))")); + + // binding + assertEquals(3L, new Venice().eval("(do " + + " (binding [x ^{:foo 3} 100] " + + " (:foo (var-val-meta 'x))))")); + + // function arg + assertEquals(3L, new Venice().eval("(do " + + " (defn bar [x] " + + " (:foo (var-val-meta 'x))) " + + " (bar (vary-meta 100 assoc :foo 3)))")); } @Test