aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/common_test.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2014-11-04 23:45:54 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2014-11-04 23:45:54 +0800
commitb96a59eb28654ba5bc915bfaa21f511fdaa443df (patch)
treec840f61e26bdf60d3a86a9dc3dfc2872fed2076f /ethutil/common_test.go
parente7d9bcd36b5809b649dc7f8e6092d5edaa0d155f (diff)
downloaddexon-b96a59eb28654ba5bc915bfaa21f511fdaa443df.tar
dexon-b96a59eb28654ba5bc915bfaa21f511fdaa443df.tar.gz
dexon-b96a59eb28654ba5bc915bfaa21f511fdaa443df.tar.bz2
dexon-b96a59eb28654ba5bc915bfaa21f511fdaa443df.tar.lz
dexon-b96a59eb28654ba5bc915bfaa21f511fdaa443df.tar.xz
dexon-b96a59eb28654ba5bc915bfaa21f511fdaa443df.tar.zst
dexon-b96a59eb28654ba5bc915bfaa21f511fdaa443df.zip
Added tests for extra large values
Test ā€œEā€ scientific notation formatting
Diffstat (limited to 'ethutil/common_test.go')
-rw-r--r--ethutil/common_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/ethutil/common_test.go b/ethutil/common_test.go
index 791ff0a25..056676765 100644
--- a/ethutil/common_test.go
+++ b/ethutil/common_test.go
@@ -79,3 +79,21 @@ func TestCommon(t *testing.T) {
t.Error("Got", wei)
}
}
+
+func TestLarge(t *testing.T) {
+ douglaslarge := CurrencyToString(BigPow(100000000, 43))
+ adalarge := CurrencyToString(BigPow(100000000, 4))
+ weilarge := CurrencyToString(big.NewInt(100000000))
+
+ if douglaslarge != "10000E298 Douglas" {
+ t.Error("Got", douglaslarge)
+ }
+
+ if adalarge != "10000E7 Einstein" {
+ t.Error("Got", adalarge)
+ }
+
+ if weilarge != "100 Babbage" {
+ t.Error("Got", weilarge)
+ }
+}