Skip to content

Commit 1d6e9f4

Browse files
committed
Adapt tests for Julia 1.12
1 parent 22f145e commit 1d6e9f4

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ This page describes the most important changes in `TypeUtils`. The format is bas
44
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
55
[Semantic Versioning](https://semver.org).
66

7+
## Unreleased
8+
9+
### Fixed
10+
11+
- Fix tests for Julia 1.12 and above.
12+
13+
714
## Version 1.10.0 (2025-07-25)
815

916
### Added

test/runtests.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,15 +1519,18 @@ same_value_and_type(x::T, y::T) where {T} = (x === y) || (x == y)
15191519

15201520
@testset "Destructure and restructure" begin
15211521
# Test with structures.
1522-
obj = Foo(2.0f0 - 3.0f0im, π, 42) # NOTE π is special
1522+
vals = (2.0f0, -3.0f0, π, 42) # NOTE π is special
1523+
obj = Foo(complex(vals[1:2]...), vals[3:end]...)
15231524
@test obj isa Foo{Float32,typeof(π)}
15241525
@test isconcretetype(typeof(obj))
15251526
@test struct_length(obj) == 4
1526-
vals = @inferred destructure(obj)
1527-
@test vals === (2.0f0, -3.0f0, π, 42)
1527+
@test vals === @inferred destructure(obj)
15281528
@test obj === @inferred restructure(typeof(obj), vals)
1529-
@test obj === restructure(parameterless(typeof(obj)), vals)
15301529
@test obj === @inferred restructure(typeof(obj), (0, 1, vals...); offset=2)
1530+
@test parameterless(typeof(obj)) === Foo
1531+
if VERSION < v"1.12.0-alpha"
1532+
@test obj === @inferred restructure(Foo, vals)
1533+
end
15311534
@test vals === @inferred destructure(Tuple, obj)
15321535
vec = destructure(Vector, obj)
15331536
@test vec == collect(vals)

0 commit comments

Comments
 (0)