Add couple tests
diff --git a/toml_test.go b/toml_test.go
index e7f8f16..c36a69c 100644
--- a/toml_test.go
+++ b/toml_test.go
@@ -15,6 +15,10 @@
if !tree.Has("test.key") {
t.Errorf("Has - expected test.key to exists")
}
+
+ if tree.Has("") {
+ t.Errorf("Should return false if the key is not provided")
+ }
}
func TestTomlHasPath(t *testing.T) {
@@ -72,3 +76,11 @@
t.Errorf("Expected 'b' with a value 2: %v", tt.Get("b"))
}
}
+
+func TestTomlFromMap(t *testing.T) {
+ simpleMap := map[string]interface{}{"hello": 42}
+ tree := TreeFromMap(simpleMap)
+ if tree.Get("hello") != 42 {
+ t.Fatal("hello should be 42, not", tree.Get("hello"))
+ }
+}