@@ -75,6 +75,11 @@ using LinearAlgebra
75
75
filtered = filter (i -> i. value < 0.7 , x)
76
76
@test length (filtered) == 7
77
77
end
78
+ @test GeometryBasics. getcolumn (plain, :name ) == pnames
79
+ @test GeometryBasics. MetaType (Polygon) == PolygonMeta{Polygon,T,Typ,Names,Types} where Types where Names where Typ<: GeometryBasics.AbstractPolygon{Polygon,T} where T
80
+ @test_throws ErrorException GeometryBasics. meta (plain)
81
+ @test GeometryBasics. MetaFree (PolygonMeta) == Polygon
82
+
78
83
end
79
84
80
85
@testset " point with metadata" begin
360
365
361
366
@test hasproperty (m, :xx )
362
367
@test hasproperty (m, :color )
368
+ @test_throws ErrorException GeometryBasics. MetaType (Simplex)
369
+ @test_throws ErrorException GeometryBasics. MetaFree (Simplex)
363
370
371
+
364
372
@test m. xx === xx
365
373
@test m. color === color
366
374
421
429
@test found && point ≈ Point (0.0 , 4.0 )
422
430
@test intersects (a, f) === (false , Point (0.0 , 0.0 ))
423
431
end
432
+ @testset " Offsetintegers" begin
433
+ x = 1
434
+ @test GeometryBasics. raw (x) isa Int64
435
+ @test GeometryBasics. value (x) == x
436
+
437
+ x = ZeroIndex (1 )
438
+ @test eltype (x) == Int64
439
+
440
+ x = OffsetInteger {0} (1 )
441
+ @test typeof (x) == OffsetInteger{0 ,Int64}
442
+
443
+ x1 = OffsetInteger {0} (2 )
444
+ @test GeometryBasics. pure_max (x, x1) == x1
445
+ @test promote_rule (typeof (x), typeof (x1)) == OffsetInteger{0 ,Int64}
446
+ x2 = 1
447
+ @test promote_rule (typeof (x2), typeof (x1)) == Int64
448
+ @test Base. to_index (x1) == 2
449
+ @test - (x1) == OffsetInteger {0,Int64} (- 2 )
450
+ @test abs (x1) == OffsetInteger {0,Int64} (2 )
451
+ @test + (x, x1) == OffsetInteger {0,Int64} (3 )
452
+ @test * (x, x1) == OffsetInteger {0,Int64} (2 )
453
+ @test - (x, x1) == OffsetInteger {0,Int64} (- 1 )
454
+ # test for /
455
+ @test div (x, x1) == OffsetInteger {0,Int64} (0 )
456
+ @test != = (x, x1)
457
+ @test ! >= (x, x1)
458
+ @test <= (x, x1)
459
+ @test ! > (x, x1)
460
+ @test < (x, x1)
461
+ end
424
462
425
463
end # testset "GeometryBasics"
0 commit comments