Added ops

This commit is contained in:
obscuren
2014-07-29 10:33:30 +02:00
parent 41bd38147c
commit 8e7c4f91e3
2 changed files with 73 additions and 2 deletions

View File

@ -63,3 +63,18 @@ func TestIterator(t *testing.T) {
i++
}
}
func TestMath(t *testing.T) {
a := NewValue(1)
a.Add(1).Add(1)
if !a.DeepCmp(NewValue(3)) {
t.Error("Expected 3, got", a)
}
a = NewValue(2)
a.Sub(1).Sub(1)
if !a.DeepCmp(NewValue(0)) {
t.Error("Expected 0, got", a)
}
}