add compare function to timedversion (#1422)

* add compare function to timedversion

* cleanup
This commit is contained in:
Paul Wells
2023-02-14 21:05:55 -08:00
committed by GitHub
parent c133b9f2e3
commit 24d8ad0da9
2 changed files with 29 additions and 0 deletions
+4
View File
@@ -36,4 +36,8 @@ func TestTimedVersion(t *testing.T) {
assert.True(t, tv2.After(tv1))
// tv3 and tv2 are equivalent after update
assert.False(t, tv3.After(tv2))
assert.Equal(t, 0, tv1.Compare(tv1))
assert.Equal(t, -1, tv1.Compare(tv2))
assert.Equal(t, 1, tv2.Compare(tv1))
}