From 31e8ef8d41655aeea6b38c891ca8216d2ebac6c3 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Thu, 25 Jul 2024 23:22:05 +0000 Subject: [PATCH] Add tests for macrocall sig --- test/parser.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/parser.jl b/test/parser.jl index 3ac3ed36..cccbcad7 100644 --- a/test/parser.jl +++ b/test/parser.jl @@ -603,6 +603,10 @@ tests = [ # body "function f() \n a \n b end" => "(function (call f) (block a b))" "function f() end" => "(function (call f) (block))" + # Macrocall as sig + ((v=v"1.12",), "function @callmemacro(a::Int) \n 1 \n end") => "(function (macrocall-p @callmemacro (::-i a Int)) (block 1))" + ((v=v"1.12",), "function @callmemacro(a::T, b::T) where T <: Int64\n3\nend") => "(function (where (macrocall-p @callmemacro (::-i a T) (::-i b T)) (<: T Int64)) (block 3))" + ((v=v"1.12",), "function @callmemacro(a::Int, b::Int, c::Int)::Float64\n4\nend") => "(function (::-i (macrocall-p @callmemacro (::-i a Int) (::-i b Int) (::-i c Int)) Float64) (block 4))" # Errors "function" => "(function (error (error)) (block (error)) (error-t))" ], @@ -963,6 +967,9 @@ tests = [ "public[7] = 5" => "(= (ref public 7) 5)" "public() = 6" => "(= (call public) 6)" ]), + JuliaSyntax.parse_stmts => [ + ((v = v"1.12",), "@callmemacro(b::Float64) = 2") => "(= (macrocall-p @callmemacro (::-i b Float64)) 2)" + ], JuliaSyntax.parse_docstring => [ """ "notdoc" ] """ => "(string \"notdoc\")" """ "notdoc" \n] """ => "(string \"notdoc\")"