|
1 |
| -using Parameters, Test, Markdown |
| 1 | +using Parameters, Test, Markdown, REPL |
2 | 2 |
|
3 | 3 | # misc
|
4 | 4 | a8679 = @eval (a=1, b=2)
|
|
34 | 34 | @test "Test documentation\n" == Markdown.plain(@doc MT1)
|
35 | 35 | # https://github.com/JuliaLang/julia/issues/27092 means this does not work:
|
36 | 36 | # @test "A field Default: sdaf\n" == Markdown.plain(@doc MT1.c)
|
37 |
| -using REPL |
38 | 37 | @test "Field r Default: 4\n" == Markdown.plain(REPL.fielddoc(MT1, :r))
|
39 | 38 | @test "A field Default: sdaf\n" == Markdown.plain(REPL.fielddoc(MT1, :c))
|
40 | 39 |
|
@@ -138,8 +137,8 @@ abstract type AMT{R<:Real} end
|
138 | 137 | r::R=5
|
139 | 138 | a::I
|
140 | 139 | end
|
141 |
| -@test_throws MethodError MT5(r=4, a=5.) # need to specify type parameters |
142 |
| -MT5{Float32, Int}(r=4, a=5.) |
| 140 | +@test_throws MethodError MT5(r=4, a=5.) # a has wrong type |
| 141 | +MT5{Float32, Int}(r=4, a=5.) # a gets converted |
143 | 142 | MT5{Float32, Int}(a=5.)
|
144 | 143 | MT5{Float32, Int}(5.4, 4) # inner positional
|
145 | 144 | mt5=MT5(5.4, 4) # outer positional
|
|
367 | 366 | @test_throws MethodError I10(a=10) # typeof(a)!=typeof(c)
|
368 | 367 | a_ = I10(a="asd")
|
369 | 368 | b_ = I10{String}("asd",10,"aaa")
|
370 |
| -for fn in fieldnames(typeof(a_)) |
371 |
| - # complicated testing because of mutable T |
372 |
| - @test getfield(a_, fn)==getfield(b_, fn) |
373 |
| -end |
| 369 | +@test a_==b_ |
374 | 370 |
|
375 | 371 | @with_kw struct I10a{T}
|
376 | 372 | a::T
|
|
0 commit comments