diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-29 16:33:30 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-29 16:33:30 +0800 |
commit | 8e7c4f91e33bd99d3a4d320cdc59cf0bab3831b6 (patch) | |
tree | f5af7ab86fd4d52240ed3a2bf96272f54153b8d0 /ethutil/value_test.go | |
parent | 41bd38147c2e5968283facf641b2444c09f53d14 (diff) | |
download | dexon-8e7c4f91e33bd99d3a4d320cdc59cf0bab3831b6.tar.gz dexon-8e7c4f91e33bd99d3a4d320cdc59cf0bab3831b6.tar.zst dexon-8e7c4f91e33bd99d3a4d320cdc59cf0bab3831b6.zip |
Added ops
Diffstat (limited to 'ethutil/value_test.go')
-rw-r--r-- | ethutil/value_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ethutil/value_test.go b/ethutil/value_test.go index a100f44bc..710cbd887 100644 --- a/ethutil/value_test.go +++ b/ethutil/value_test.go @@ -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) + } +} |