Skip to content

Commit 26fd94b

Browse files
committed
Add tests, add missing file from treep.asd
1 parent edca649 commit 26fd94b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/main.lisp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
(ok (= 1 1))))
1313

1414
(deftest symbols-test
15+
(testing "We can find imported symbols"
16+
(ok (eq treep-impl::+symbol-treep+ (find-symbol "treep" treep-impl::+root-symbol+)))
17+
(ok (eq treep-impl::+symbol-seq+ (find-symbol "seq" treep-impl::+symbol-treep+))))
18+
(testing "Symbol identity persists through file compilation"
19+
(ok (eq (load-time-value (intern "test" treep-impl::+root-symbol+)) (intern "test" treep-impl::+root-symbol+)))
20+
;; Note compiling then loading a compiled file doesn't preserve the identity of uninterned symbols, so if we want to generate
21+
;; Lisp s-expressions and dump those to a file to file-compile it, a strategy is needed to replace literal symbols with calls to intern.
22+
(ok (not (eq '#.(intern "test" treep-impl::+root-symbol+) (intern "test" treep-impl::+root-symbol+)))))
1523
(testing "The default search path of a symbol includes its parent"
1624
(ok (eq treep-impl::+symbol-seq+ (find-symbol "seq" treep-impl::+symbol-repl+)))))
1725

treep.asd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
:depends-on ("closer-mop" "fset")
66
:components ((:module "src/level0"
77
:components
8-
((:file "packages") (:file "symbols")
8+
((:file "packages")
9+
(:file "symbols") (:file "symbols-io")
910
(:file "forms") (:file "abstractions")
1011
(:file "reader")
1112
(:file "printer")

0 commit comments

Comments
 (0)