Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Dec 16, 2024
1 parent 9324e91 commit ba20326
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/compiler/semantic/macro_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,21 @@ describe "Semantic: macro" do
CRYSTAL
end

it "being with {{ yield }} (#15050)", focus: true do
result = top_level_semantic <<-CRYSTAL, wants_doc: true
macro foo
{{yield}}
end
foo do
# doc comment
def test
end
end
CRYSTAL
result.program.defs.try(&.["test"][0].def.doc).should eq "doc comment"
end

it "can return class type in macro def" do
assert_type(<<-CRYSTAL) { types["Int32"].metaclass }
class Foo
Expand Down

0 comments on commit ba20326

Please sign in to comment.