@@ -423,6 +423,7 @@ struct IncompleteInterval <: AbstractInterval{Int} end
423
423
@test OpenInterval (i1) ∩ Interval {:closed,:open} (i2) ≡ Interval {:closed,:open} (i2) ∩ OpenInterval (i1) ≡ Interval {:closed,:open} (i2)
424
424
@test Interval {:open,:closed} (i1) ∩ OpenInterval (i2) ≡ OpenInterval (i2) ∩ Interval {:open,:closed} (i1) ≡ OpenInterval (i2)
425
425
@test Interval {:open,:closed} (i1) ∩ Interval {:closed,:open} (i2) ≡ Interval {:closed,:open} (i2) ∩ Interval {:open,:closed} (i1) ≡ Interval {:closed,:open} (i2)
426
+ @test ! isdisjoint (i1, i2)
426
427
427
428
428
429
# - union of partially overlapping intervals
@@ -462,6 +463,7 @@ struct IncompleteInterval <: AbstractInterval{Int} end
462
463
@test OpenInterval (i1) ∩ Interval {:closed,:open} (i3) ≡ Interval {:closed,:open} (i3) ∩ OpenInterval (i1) ≡ Interval {:closed,:open} (d)
463
464
@test Interval {:open,:closed} (i1) ∩ OpenInterval (i3) ≡ OpenInterval (i3) ∩ Interval {:open,:closed} (i1) ≡ Interval {:open,:closed} (d)
464
465
@test Interval {:open,:closed} (i1) ∩ Interval {:closed,:open} (i3) ≡ Interval {:closed,:open} (i3) ∩ Interval {:open,:closed} (i1) ≡ d
466
+ @test ! isdisjoint (i1, i3)
465
467
466
468
467
469
# - union of barely overlapping intervals
@@ -524,6 +526,11 @@ struct IncompleteInterval <: AbstractInterval{Int} end
524
526
@test isempty (OpenInterval (i1) ∩ i4)
525
527
@test isempty (i1 ∩ OpenInterval (i4))
526
528
@test isempty (Interval {:closed,:open} (i1) ∩ i4)
529
+ @test isdisjoint (i1, i4)
530
+ @test isdisjoint (i4, i1)
531
+ @test isdisjoint (OpenInterval (i1), i4)
532
+ @test isdisjoint (i1, OpenInterval (i4))
533
+ @test isdisjoint (Interval {:closed,:open} (i1), i4)
527
534
528
535
529
536
# - intersection of almost-overlapping intervals
@@ -532,6 +539,11 @@ struct IncompleteInterval <: AbstractInterval{Int} end
532
539
@test isempty (OpenInterval (i1) ∩ i5)
533
540
@test isempty (i1 ∩ OpenInterval (i5))
534
541
@test isempty (Interval {:closed,:open} (i1) ∩ i5)
542
+ @test isdisjoint (i1, i5)
543
+ @test isdisjoint (i5, i1)
544
+ @test isdisjoint (OpenInterval (i1), i5)
545
+ @test isdisjoint (i1, OpenInterval (i5))
546
+ @test isdisjoint (Interval {:closed,:open} (i1), i5)
535
547
536
548
# - union of interval with empty
537
549
@test i1 ∪ i_empty ≡ i_empty ∪ i1 ≡ i1
@@ -556,6 +568,11 @@ struct IncompleteInterval <: AbstractInterval{Int} end
556
568
@test isempty (OpenInterval (i1) ∩ i_empty)
557
569
@test isempty (i1 ∩ OpenInterval (i_empty))
558
570
@test isempty (Interval {:closed,:open} (i1) ∩ i_empty)
571
+ @test isdisjoint (i1, i_empty)
572
+ @test isdisjoint (i_empty, i1)
573
+ @test isdisjoint (OpenInterval (i1), i_empty)
574
+ @test isdisjoint (i1, OpenInterval (i_empty))
575
+ @test isdisjoint (Interval {:closed,:open} (i1), i_empty)
559
576
560
577
# - test matching endpoints
561
578
@test (0 .. 1 ) ∪ OpenInterval (0 .. 1 ) ≡ OpenInterval (0 .. 1 ) ∪ (0 .. 1 ) ≡ 0 .. 1
0 commit comments