File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 216216
217217" Test for function definition expressions."
218218isdef (ex) = ismatch (or_ (:(function _ (__) _ end ),
219- :(f_ (__) = _)),
219+ :(function _ (__):: _ _ end ),
220+ :(f_ (__) = _),
221+ :(f_ (__):: _ = _)),
220222 ex)
221223
222224isshortdef (ex) = (@capture (ex, (fcall_ = body_)) &&
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ using Test
66include (" match.jl" )
77include (" split.jl" )
88include (" destruct.jl" )
9+ include (" utils.jl" )
910
1011end
Original file line number Diff line number Diff line change 1+ using MacroTools: isdef
2+
3+ @testset " utils" begin
4+ ex1 = :(function foo (a) return a; end )
5+ @test isdef (ex1)
6+ ex2 = :(function bar (a):: Int return 1 ; end )
7+ @test isdef (ex2)
8+ ex3 = :(f (a) = a)
9+ @test isdef (ex3)
10+ ex4 = :(f (a):: Int = 1 )
11+ @test isdef (ex4)
12+ end
You can’t perform that action at this time.
0 commit comments