Add a lib/interval sharedEmptyRange global

This commit is contained in:
Nigel Tao committed 2019-11-02 11:32:54 +11:00
1 parent 3b56ace877
commit 648932e0fb
2 files changed
+16 -10

No files matched your search

+4 -4
View File
@@ -283,8 +283,8 @@ func TestContainsEtc(tt *testing.T) {
tt.Errorf("%s.Empty(): got %t, want %t", tc.s, got, want)
} else if !got {
eqTestCases = append(eqTestCases, x)
} else if !x.Eq(makeEmptyRange()) {
tt.Errorf("%v eq %v: got %t, want %t", x, makeEmptyRange(), got, want)
} else if !x.Eq(sharedEmptyRange) {
tt.Errorf("%v eq %v: got %t, want %t", x, sharedEmptyRange, got, want)
}
if got, want := x.justZero(), tc.s == "[ 0, 0]"; got != want {
@@ -929,7 +929,7 @@ func TestOpAndWithZero(tt *testing.T) {
x := IntRange{x0, x1}
want := zero
if x.Empty() {
want = makeEmptyRange()
want = sharedEmptyRange
}
if got, _ := x.And(zero); !got.Eq(want) {
@@ -949,7 +949,7 @@ func TestOpOrWithMinusOne(tt *testing.T) {
x := IntRange{x0, x1}
want := minusOne
if x.Empty() {
want = makeEmptyRange()
want = sharedEmptyRange
}
if got, _ := x.Or(minusOne); !got.Eq(want) {