Skip to content

Commit 212a84f

Browse files
committed
Added test for particular use of SubTree
1 parent 7ac4ce8 commit 212a84f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

properties_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,24 @@ func TestPropertiesRedBeearLabBoardsTxt(t *testing.T) {
129129
require.Equal(t, "arduino:arduino", ethernet["build.core"])
130130
}
131131

132+
func TestSubTreeForMultipleDots(t *testing.T) {
133+
p := Map{
134+
"root.lev1.prop": "hi",
135+
"root.lev1.prop2": "how",
136+
"root.lev1.prop3": "are",
137+
"root.lev1.prop4": "you",
138+
"root.lev1": "A",
139+
}
140+
141+
lev1 := p.SubTree("root.lev1")
142+
require.EqualValues(t, Map{
143+
"prop4": "you",
144+
"prop": "hi",
145+
"prop2": "how",
146+
"prop3": "are",
147+
}, lev1)
148+
}
149+
132150
func TestPropertiesBroken(t *testing.T) {
133151
_, err := Load(filepath.Join("testdata", "broken.txt"))
134152

0 commit comments

Comments
 (0)