Skip to content
Closed
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions stdlib/Test/src/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,20 @@ function eval_test(evaluated::Expr, quoted::Expr, source::LineNumberNode, negate
if res
res = op(a, b)
end
quoted_args[i] = a
quoted_args[i+2] = b
if a isa Symbol
quoted_args[i] = QuoteNode(a)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it woud be better to put the whole logic into a function so it doesn't have to be repeated for both a and b.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That function is the existing Base.quoted function in this case

elseif Meta.isexpr(a, :call)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case is this used? What difference does it make?

quoted_args[i] = :($a)
else
quoted_args[i] = a
end
if b isa Symbol
quoted_args[i+2] = QuoteNode(b)
elseif Meta.isexpr(b, :call)
quoted_args[i+2] = :($b)
else
quoted_args[i+2] = b
end
i += 2
end

Expand Down