Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

Commit dbe0e8f

Browse files
authored
Merge pull request JuliaLang/julia#39351 from JuliaLang/backports-release-1.5
Backports 1.5.4
2 parents 5048c42 + 080327a commit dbe0e8f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Test.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,10 @@ function get_test_result(ex, source)
455455
push!(escaped_kwargs, Expr(:call, :(=>), QuoteNode(a.args[1]), esc(a.args[2])))
456456
elseif isa(a, Expr) && a.head === :...
457457
push!(escaped_kwargs, Expr(:..., esc(a.args[1])))
458+
elseif isa(a, Expr) && a.head === :.
459+
push!(escaped_kwargs, Expr(:call, :(=>), QuoteNode(a.args[2].value), esc(Expr(:., a.args[1], QuoteNode(a.args[2].value)))))
460+
elseif isa(a, Symbol)
461+
push!(escaped_kwargs, Expr(:call, :(=>), QuoteNode(a), esc(a)))
458462
end
459463
end
460464
end

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ using Test: guardseed
66
import Logging: Debug, Info, Warn
77

88
@testset "@test" begin
9+
atol = 1
10+
a = (; atol=2)
911
@test true
1012
@test 1 == 1
1113
@test 1 != 2
@@ -18,11 +20,16 @@ import Logging: Debug, Info, Warn
1820
@test isapprox(1, 1, atol=0.1)
1921
@test isapprox(1, 1; atol=0.1)
2022
@test isapprox(1, 1; [(:atol, 0)]...)
23+
@test isapprox(1, 2; atol)
24+
@test isapprox(1, 3; a.atol)
2125
end
2226
@testset "@test keyword precedence" begin
27+
atol = 2
2328
# post-semicolon keyword, suffix keyword, pre-semicolon keyword
2429
@test isapprox(1, 2, atol=0) atol=1
2530
@test isapprox(1, 3, atol=0; atol=2) atol=1
31+
@test isapprox(1, 2, atol=0; atol)
32+
@test isapprox(1, 3, atol=0; atol) atol=1
2633
end
2734
@testset "@test should only evaluate the arguments once" begin
2835
g = Int[]

0 commit comments

Comments
 (0)