Added test for NewNode

This commit is contained in:
Bruce Marriner 2019-04-12 17:30:32 -05:00
parent cdbb8ee279
commit c09e69ae59

View File

@ -9,6 +9,20 @@ import (
//******************************************************************************
// General Test funcs
func TestNewNode(t *testing.T) {
_, err := NewNode(0)
if err != nil {
t.Fatalf("error creating NewNode, %s", err)
}
_, err = NewNode(5000)
if err == nil {
t.Fatalf("no error creating NewNode, %s", err)
}
}
// lazy check if Generate will create duplicate IDs
// would be good to later enhance this with more smarts
func TestGenerateDuplicateID(t *testing.T) {