From 935fa1d6fb6295361563ea8a9640497469114ac7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 22 Jul 2014 08:53:03 -0700 Subject: [PATCH] config: tests --- config/interpolate_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/config/interpolate_test.go b/config/interpolate_test.go index 32d1f9869..3b01c6cd7 100644 --- a/config/interpolate_test.go +++ b/config/interpolate_test.go @@ -133,6 +133,23 @@ func TestNewUserVariable(t *testing.T) { } } +func TestNewUserVariable_map(t *testing.T) { + v, err := NewUserVariable("var.bar.baz") + if err != nil { + t.Fatalf("err: %s", err) + } + + if v.Name != "bar" { + t.Fatalf("bad: %#v", v.Name) + } + if v.Elem != "baz" { + t.Fatalf("bad: %#v", v.Elem) + } + if v.FullKey() != "var.bar.baz" { + t.Fatalf("bad: %#v", v) + } +} + func TestFunctionInterpolation_impl(t *testing.T) { var _ Interpolation = new(FunctionInterpolation) }