good morning!!!!

Skip to content
Snippets Groups Projects
Commit e22e8b7f authored by Taylor Gerring's avatar Taylor Gerring
Browse files

Environment tests

parent f59a3b67
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,36 @@ package ethutil
import (
"math/big"
"os"
"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) {
ether := CurrencyToString(BigPow(10, 19))
finney := CurrencyToString(BigPow(10, 16))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment