Created
March 22, 2021 21:43
-
-
Save jchapuis/5f39159f1f31e6f82c8e6ac440a9f678 to your computer and use it in GitHub Desktop.
Parsable diagrams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"DateTimeInterval.relate" should { | |
"return Disjoint" in new Fixture { | |
val a = "+---+ " | |
val b = " +--+" | |
a.relateTo(b) shouldBe Disjoint | |
b.relateTo(a) shouldBe Disjoint | |
} | |
"return IncludedBy and Includes" in new Fixture { | |
val a = " +-------+ " | |
val b = " +--+ " | |
a.relateTo(b) shouldBe Includes | |
b.relateTo(a) shouldBe IncludedBy | |
} | |
"return IncludesFlushRight and IncludedByFlushRight when flush right" in new Fixture { | |
val a = " +---------+ " | |
val b = " +-----+ " | |
a.relateTo(b) shouldBe IncludesFlushRight | |
b.relateTo(a) shouldBe IncludedByFlushRight | |
} | |
"return IncludesFlushLeft and IncludedByFlushLeft when flush left" in new Fixture { | |
val a = " +---------+ " | |
val b = " +-----+ " | |
a.relateTo(b) shouldBe IncludesFlushLeft | |
b.relateTo(a) shouldBe IncludedByFlushLeft | |
} | |
"return Overlaps left and right" in new Fixture { | |
val a = " +------+ " | |
val b = " +-----+ " | |
a.relateTo(b) shouldBe OverlapsLeft | |
b.relateTo(a) shouldBe OverlapsRight | |
val c = " +------+ " | |
val d = " +---+ " | |
c.relateTo(d) shouldBe OverlapsRight | |
d.relateTo(c) shouldBe OverlapsLeft | |
val f = " +----+ " | |
val e = " +-+ " | |
f.relateTo(e) shouldBe OverlapsRight | |
e.relateTo(f) shouldBe OverlapsLeft | |
} | |
"return Equals" in new Fixture { | |
val a = " +---------+ " | |
val b = " +---------+ " | |
a.relateTo(b) shouldBe Equals | |
b.relateTo(a) shouldBe Equals | |
val c = " ++ " | |
val d = " ++ " | |
c.relateTo(d) shouldBe Equals | |
d.relateTo(c) shouldBe Equals | |
} | |
"return AbutsLeft and AbutsRight" in new Fixture { | |
val a = " +----+ " | |
val b = " +-----+ " | |
a.relateTo(b) shouldBe AbutsLeft | |
b.relateTo(a) shouldBe AbutsRight | |
val c = " +----+ " | |
val d = " +-----+ " | |
c.relateTo(d) shouldBe AbutsRight | |
d.relateTo(c) shouldBe AbutsLeft | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment