Skip to content

Commit 554d3d0

Browse files
committed
Tests to ensure that Tuple(::StaticArray) is @inferred
1 parent 5796f5a commit 554d3d0

File tree

8 files changed

+12
-8
lines changed

8 files changed

+12
-8
lines changed

test/FieldVector.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
@test length(p) === 3
1919
@test eltype(p) === Float64
2020

21+
@testinf Tuple(p) === (1.0, 2.0, 3.0)
22+
2123
@test (p + p) === Point3D(2.0, 4.0, 6.0)
2224

2325
@test (p[1], p[2], p[3]) === (p.x, p.y, p.z)
@@ -59,6 +61,8 @@
5961
@test length(p) === 2
6062
@test eltype(p) === Float64
6163

64+
@testinf Tuple(p) === (1.0, 2.0)
65+
6266
@test (p[1], p[2]) === (p.x, p.y)
6367
@test (p[1], p[2]) === (1.0, 2.0)
6468

test/MArray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
@test m[3] === 13
102102
@test m[4] === 14
103103

104-
@test Tuple(m) === (11, 12, 13, 14)
104+
@testinf Tuple(m) === (11, 12, 13, 14)
105105

106106
@test size(m) === (2, 2)
107107
@test size(typeof(m)) === (2, 2)

test/MMatrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
@test m[3] === 13
7777
@test m[4] === 14
7878

79-
@test Tuple(m) === (11, 12, 13, 14)
79+
@testinf Tuple(m) === (11, 12, 13, 14)
8080

8181
@test size(m) === (2, 2)
8282
@test size(typeof(m)) === (2, 2)

test/MVector.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
@test v[2] === 12
5757
@test v[3] === 13
5858

59-
@test Tuple(v) === (11, 12, 13)
59+
@testinf Tuple(v) === (11, 12, 13)
6060

6161
@test size(v) === (3,)
6262
@test size(typeof(v)) === (3,)

test/SArray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
@test m[3] === 13
9797
@test m[4] === 14
9898

99-
@test Tuple(m) === (11, 12, 13, 14)
99+
@testinf Tuple(m) === (11, 12, 13, 14)
100100

101101
@test size(m) === (2, 2)
102102
@test size(typeof(m)) === (2, 2)

test/SMatrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
@test m[3] === 13
7575
@test m[4] === 14
7676

77-
@test Tuple(m) === (11, 12, 13, 14)
77+
@testinf Tuple(m) === (11, 12, 13, 14)
7878

7979
@test size(m) === (2, 2)
8080
@test size(typeof(m)) === (2, 2)

test/SVector.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
@test v[2] === 12
5656
@test v[3] === 13
5757

58-
@test Tuple(v) === (11, 12, 13)
58+
@testinf Tuple(v) === (11, 12, 13)
5959

6060
@test size(v) === (3,)
6161
@test size(typeof(v)) === (3,)

test/Scalar.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
@test (Scalar(1) + Scalar(1.0))::Scalar{Float64} Scalar(2.0)
55
@test_throws ErrorException Scalar(2)[2]
66
@test Scalar(2)[] == 2
7-
@test Tuple(Scalar(2)) == (2,)
8-
@test Tuple(convert(Scalar{Float64}, [2.0])) == (2.0,)
7+
@testinf Tuple(Scalar(2)) === (2,)
8+
@testinf Tuple(convert(Scalar{Float64}, [2.0])) === (2.0,)
99
a = Array{Float64, 0}(undef)
1010
a[] = 2
1111
@test Scalar(a)[] == 2

0 commit comments

Comments
 (0)