MCPcopy
hub / github.com/golang/geo / TestSimplePredicates

Function TestSimplePredicates

s1/interval_test.go:95–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func TestSimplePredicates(t *testing.T) {
96 if !zero.IsValid() || zero.IsEmpty() || zero.IsFull() {
97 t.Errorf("Zero interval is invalid or empty or full")
98 }
99 if !empty.IsValid() || !empty.IsEmpty() || empty.IsFull() {
100 t.Errorf("Empty interval is invalid or not empty or full")
101 }
102 if !empty.IsInverted() {
103 t.Errorf("Empty interval is not inverted")
104 }
105 if !full.IsValid() || full.IsEmpty() || !full.IsFull() {
106 t.Errorf("Full interval is invalid or empty or not full")
107 }
108 if !pi.IsValid() || pi.IsEmpty() || pi.IsInverted() {
109 t.Errorf("pi is invalid or empty or inverted")
110 }
111 if !mipi.IsValid() || mipi.IsEmpty() || mipi.IsInverted() {
112 t.Errorf("mipi is invalid or empty or inverted")
113 }
114}
115
116func TestAlmostFullOrEmpty(t *testing.T) {
117 // Test that rounding errors don't cause intervals that are almost empty or

Callers

nothing calls this directly

Calls 4

IsInvertedMethod · 0.80
IsEmptyMethod · 0.65
IsFullMethod · 0.65
IsValidMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…