Skip to content

Commit

Permalink
Fix tests on 1.10 (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenpi authored Aug 13, 2024
1 parent ec66ad4 commit f65720c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- master
tags:
- '*'
schedule:
- cron: '0 0 * * 1' # runs 00:00 UTC on every Monday
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
Expand Down
41 changes: 34 additions & 7 deletions test/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,15 @@ end
DSE.format(SIGNATURES, buf, doc)
str = String(take!(buf))
@test occursin("\n```julia\n", str)
@test occursin("\ng()\n", str)
@test occursin("\ng(x)\n", str)
# On 1.10+, automatically generated methods have keywords in the metadata,
# hence the display difference between Julia versions.
if VERSION >= v"1.10"
@test occursin("\ng(; ...)\n", str)
@test occursin("\ng(x; ...)\n", str)
else
@test occursin("\ng()\n", str)
@test occursin("\ng()\n", str)
end
@test occursin("\n```\n", str)

doc.data = Dict(
Expand All @@ -163,9 +170,17 @@ end
DSE.format(SIGNATURES, buf, doc)
str = String(take!(buf))
@test occursin("\n```julia\n", str)
@test occursin("\ng()\n", str)
@test occursin("\ng(x)\n", str)
@test occursin("\ng(x, y)\n", str)
# On 1.10+, automatically generated methods have keywords in the metadata,
# hence the display difference between Julia versions.
if VERSION >= v"1.10"
@test occursin("\ng(; ...)\n", str)
@test occursin("\ng(x; ...)\n", str)
@test occursin("\ng(x, y; ...)\n", str)
else
@test occursin("\ng()\n", str)
@test occursin("\ng(x)\n", str)
@test occursin("\ng(x, y)\n", str)
end
@test occursin("\ng(x, y, z; kwargs...)\n", str)
@test occursin("\n```\n", str)

Expand Down Expand Up @@ -245,9 +260,21 @@ end
str = String(take!(buf))
@test occursin("\n```julia\n", str)
if typeof(1) === Int64
@test occursin("\nh(x::Int64) -> Int64\n", str)
# On 1.10+, automatically generated methods have keywords in the metadata,
# hence the display difference between Julia versions.
if VERSION >= v"1.10"
@test occursin("\nh(x::Int64; ...) -> Int64\n", str)
else
@test occursin("\nh(x::Int64) -> Int64\n", str)
end
else
@test occursin("\nh(x::Int32) -> Int32\n", str)
# On 1.10+, automatically generated methods have keywords in the metadata,
# hence the display difference between Julia versions.
if VERSION >= v"1.10"
@test occursin("\nh(x::Int32; ...) -> Int32\n", str)
else
@test occursin("\nh(x::Int32) -> Int32\n", str)
end
end
@test occursin("\n```\n", str)

Expand Down

0 comments on commit f65720c

Please sign in to comment.