summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/magiconair/properties/properties_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/magiconair/properties/properties_test.go')
-rw-r--r--vendor/github.com/magiconair/properties/properties_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/magiconair/properties/properties_test.go b/vendor/github.com/magiconair/properties/properties_test.go
index 0eac1f492..7e92618e0 100644
--- a/vendor/github.com/magiconair/properties/properties_test.go
+++ b/vendor/github.com/magiconair/properties/properties_test.go
@@ -458,6 +458,19 @@ func TestDisableExpansion(t *testing.T) {
assert.Equal(t, p.MustGet("keyB"), "${keyA}")
}
+func TestDisableExpansionStillUpdatesKeys(t *testing.T) {
+ p := NewProperties()
+ p.MustSet("p1", "a")
+ assert.Equal(t, p.Keys(), []string{"p1"})
+ assert.Equal(t, p.String(), "p1 = a\n")
+
+ p.DisableExpansion = true
+ p.MustSet("p2", "b")
+
+ assert.Equal(t, p.Keys(), []string{"p1", "p2"})
+ assert.Equal(t, p.String(), "p1 = a\np2 = b\n")
+}
+
func TestMustGet(t *testing.T) {
input := "key = value\nkey2 = ghi"
p := mustParse(t, input)