Skip to content

Commit 11ad2e6

Browse files
committed
Fixed bugs in tests.
1 parent 5431ff6 commit 11ad2e6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/JiL.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module JiL
2-
export debug_lisp_to_julia, install_jil_parser, restore_julia_parser, tojulia, @jil_str
2+
export debug_lisp_to_julia, install_jil_parser, restore_julia_parser, tojulia, @jil_str, @julia_str
33
include("List.jl")
44
include("ToJulia.jl")
55
include("JiLParser.jl")
@@ -12,6 +12,10 @@ macro jil_str(str)
1212
end
1313
end
1414

15+
macro julia_str(str)
16+
QuoteNode(Base.remove_linenums!(Meta.parse(str)))
17+
end
18+
1519
__init__() = begin
1620
install_jil_parser() # Let's have the parser ready
1721
include(joinpath(@__DIR__, "Boot0.jil")) # Primitive operations (car, cdr, null?, defmacro, etc)

test/runtests.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using JiL
22
using Test
33

4+
5+
46
@testset "JiL.jl" begin
5-
@test jil"(define foo 1)" == :(foo = 1)
6-
@test jil"(define (bar x) 1)" == :(bar(x) = begin 1 end)
7+
@test jil"(define foo 1)" == julia"foo = 1"
8+
@test jil"(define (bar x) 1)" == julia"bar(x) = begin 1 end"
79
end

0 commit comments

Comments
 (0)