|
463 | 463 | ) |
464 | 464 | DSE.format(DSE.TYPEDSIGNATURESNORETURN, buf, doc) |
465 | 465 | str = String(take!(buf)) |
466 | | - @test occursin("\n```julia\n", str) |
467 | | - f = str -> replace(str, " " => "") |
468 | | - str = f(str) |
469 | | - if Sys.iswindows() && VERSION < v"1.8" |
470 | | - @test occursin(f("h_1(x::Union{Array{T,4}, Array{T,3}} where T)"), str) |
471 | | - else |
472 | | - @test occursin(f("h_1(x::Union{Array{T,3}, Array{T,4}} where T)"), str) |
473 | | - end |
474 | | - @test !occursin("->", str) |
475 | | - @test occursin("\n```\n", str) |
476 | | - |
| 466 | + @test_reference "references/typed_no_return/h_1.txt" str |
477 | 467 |
|
478 | 468 | doc.data = Dict( |
479 | 469 | :binding => Docs.Binding(M, :g_2), |
|
482 | 472 | ) |
483 | 473 | DSE.format(TYPEDSIGNATURESNORETURN, buf, doc) |
484 | 474 | str = String(take!(buf)) |
485 | | - @test occursin("\n```julia\n", str) |
486 | | - @test occursin("\ng_2(x::String)", str) |
487 | | - @test occursin("\n```\n", str) |
| 475 | + @test_reference "references/typed_no_return/g_2.txt" str |
488 | 476 |
|
489 | 477 | doc.data = Dict( |
490 | 478 | :binding => Docs.Binding(M, :h), |
|
493 | 481 | ) |
494 | 482 | DSE.format(DSE.TYPEDSIGNATURESNORETURN, buf, doc) |
495 | 483 | str = String(take!(buf)) |
496 | | - @test occursin("\n```julia\n", str) |
497 | | - if typeof(1) === Int64 |
498 | | - @test occursin("\nh(x::Int64, y::Int64, z::Int64; kwargs...)\n", str) |
499 | | - else |
500 | | - @test occursin("\nh(x::Int32, y::Int32, z::Int32; kwargs...)\n", str) |
501 | | - end |
502 | | - @test occursin("\n```\n", str) |
| 484 | + @test_reference "references/typed_no_return/h_int_int_int.txt" str |
503 | 485 |
|
504 | 486 | doc.data = Dict( |
505 | 487 | :binding => Docs.Binding(M, :h), |
|
508 | 490 | ) |
509 | 491 | DSE.format(DSE.TYPEDSIGNATURESNORETURN, buf, doc) |
510 | 492 | str = String(take!(buf)) |
511 | | - @test occursin("\n```julia\n", str) |
512 | | - if typeof(1) === Int64 |
513 | | - # On 1.10+, automatically generated methods have keywords in the metadata, |
514 | | - # hence the display difference between Julia versions. |
515 | | - if VERSION >= v"1.10" |
516 | | - @test occursin("\nh(x::Int64; ...)\n", str) |
517 | | - else |
518 | | - @test occursin("\nh(x::Int64)\n", str) |
519 | | - end |
520 | | - else |
521 | | - # On 1.10+, automatically generated methods have keywords in the metadata, |
522 | | - # hence the display difference between Julia versions. |
523 | | - if VERSION >= v"1.10" |
524 | | - @test occursin("\nh(x::Int32; ...)\n", str) |
525 | | - else |
526 | | - @test occursin("\nh(x::Int32)\n", str) |
527 | | - end |
528 | | - end |
529 | | - @test occursin("\n```\n", str) |
530 | | - |
| 493 | + @test_reference "references/typed_no_return/h_int.txt" str |
531 | 494 | end |
532 | 495 |
|
533 | 496 | @testset "function names" begin |
|
0 commit comments