Skip to content

Commit cad757e

Browse files
committed
Support JET@0.11 in tests
1 parent 3f4cb79 commit cad757e

3 files changed

Lines changed: 19 additions & 18 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ StatsAPI = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
2121
AliasTables = "1"
2222
DataAPI = "1"
2323
DataStructures = "0.10, 0.11, 0.12, 0.13, 0.14, 0.17, 0.18, 0.19"
24-
JET = "0.9.18, 0.10"
24+
JET = "0.9.18, 0.10, 0.11"
2525
LinearAlgebra = "<0.0.1, 1"
2626
LogExpFunctions = "0.3"
2727
Missings = "0.3, 0.4, 1.0"

src/pairwise.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function check_vectors(x, y, skipmissing::Symbol)
4040
end
4141
end
4242
if m > 1 && n > 1
43-
indsx == indsy ||
43+
keys(first(x)) == keys(first(y)) ||
4444
throw(ArgumentError("All input vectors must have the same indices"))
4545
end
4646
end

test/jet.jl

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
using StatsBase, Test
22
import JET
33

4-
# JET has only experimental support for Julia 1.12 currently
5-
# It throws an internal `AssertionError` in the tests below
6-
if VERSION < v"1.12-"
7-
@testset "JET" begin
8-
# Check that there are no undefined global references and undefined field accesses
9-
JET.test_package("StatsBase"; target_defined_modules = true, mode = :typo)
4+
@testset "JET" begin
5+
# Check that there are no undefined global references and undefined field accesses
6+
JET.test_package(StatsBase; target_modules = (StatsBase,), mode = :typo)
107

11-
# Default error analysis for common problem fails since JET errors on interface definitions
12-
# The (deprecated) `model_response(::StatisticalModel)` calls the interface
13-
# function `response(::StatisticalModel)` for which no method exists yet
14-
# Note: This analysis is not enough strict to guarantee that there are no runtime errors!
15-
# Ref https://github.com/aviatesk/JET.jl/issues/495
16-
res = JET.report_package("StatsBase"; target_defined_modules = true, mode = :basic, toplevel_logger = nothing)
17-
println(res)
18-
reports = JET.get_reports(res)
19-
@test_broken isempty(reports)
20-
@test length(reports) <= 1
8+
# Default error analysis
9+
# Note: This analysis is not enough strict to guarantee that there are no runtime errors!
10+
kwargs = if isdefined(JET, :LastFrameModuleExact) # JET@0.11
11+
(; target_modules = (StatsBase,))
12+
else
13+
(; target_defined_modules = true)
2114
end
15+
# The (deprecated) `model_response(::StatisticalModel)` calls the interface
16+
# function `response(::StatisticalModel)` for which no method exists yet
17+
# Ref https://github.com/aviatesk/JET.jl/issues/495
18+
res = JET.report_package(StatsBase; kwargs..., mode = :basic, toplevel_logger = nothing)
19+
println(res)
20+
reports = JET.get_reports(res)
21+
@test_broken isempty(reports)
22+
@test length(reports) <= 1
2223
end

0 commit comments

Comments
 (0)