mirror of https://github.com/status-im/op-geth.git
Environment tests
This commit is contained in:
parent
f59a3b67f6
commit
e22e8b7fef
|
@ -2,9 +2,36 @@ package ethutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestOS(t *testing.T) {
|
||||||
|
res := IsWindows()
|
||||||
|
|
||||||
|
if res && (os.PathSeparator != '\\' || os.PathListSeparator != ';') {
|
||||||
|
t.Error("IsWindows is", res, "but path is", os.PathSeparator)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !res && (os.PathSeparator == '\\' && os.PathListSeparator == ';') {
|
||||||
|
t.Error("IsWindows is", res, "but path is", os.PathSeparator)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestWindonziePath(t *testing.T) {
|
||||||
|
path := "/opt/eth/test/file.ext"
|
||||||
|
res := WindonizePath(path)
|
||||||
|
iswindowspath := os.PathSeparator == '\\'
|
||||||
|
|
||||||
|
if !iswindowspath && string(res[0]) != "/" {
|
||||||
|
t.Error("Got", res)
|
||||||
|
}
|
||||||
|
|
||||||
|
if iswindowspath && string(res[0]) == "/" {
|
||||||
|
t.Error("Got", res)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestCommon(t *testing.T) {
|
func TestCommon(t *testing.T) {
|
||||||
ether := CurrencyToString(BigPow(10, 19))
|
ether := CurrencyToString(BigPow(10, 19))
|
||||||
finney := CurrencyToString(BigPow(10, 16))
|
finney := CurrencyToString(BigPow(10, 16))
|
||||||
|
|
Loading…
Reference in New Issue