Skip to content

Commit a18eef4

Browse files
committed
add some tests for to_ndim
1 parent e4b25ed commit a18eef4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/fixed_arrays.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Test
2+
using GeometryBasics: to_ndim
23

34
@testset "Construction and Conversion" begin
45
for VT in [Point, Vec]
@@ -19,6 +20,10 @@ using Test
1920

2021
@test convert(Point, (2, 3)) === Point(2, 3)
2122
@test convert(Point, (2.0, 3)) === Point(2.0, 3.0)
23+
24+
@test to_ndim(Point3f, Vec2i(1,2), 0) == Point3f(1,2,0)
25+
@test to_ndim(Vec4i, (1f0, 2), 0) == Vec4i(1,2,0,0)
26+
@test to_ndim(NTuple{2, Float64}, Point3f(1,2,3), 0) == (1.0, 2.0)
2227
end
2328

2429
@testset "broadcast" begin

0 commit comments

Comments
 (0)