Skip to content

Commit 807b6df

Browse files
Add new test for depth
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent ff33210 commit 807b6df

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Tests/powershell-yaml.Tests.ps1

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,47 @@ anArrayKey: [1, 2, 3]
121121
}
122122
}
123123

124+
Describe "Test serialized depth" {
125+
Context "Deeply nested objects are serialized correctly" {
126+
It "Should deserialize the entire object" {
127+
$data = @"
128+
children:
129+
appliance:
130+
bla:
131+
bla2:
132+
bla3:
133+
bla4:
134+
bla5:
135+
bla6:
136+
bla7:
137+
bla8:
138+
bla9:
139+
bla10:
140+
bla11:
141+
bla12:
142+
bla13:
143+
bla14:
144+
bla15:
145+
bla16:
146+
bla17:
147+
bla17:
148+
bla17:
149+
bla17:
150+
bla17:
151+
bla17:
152+
bla17:
153+
bla17:
154+
- 192.168.0.1
155+
- 192.168.0.2
156+
- 192.168.0.3
157+
158+
"@
159+
$result = cfy $data | cty
160+
Assert-Equivalent -Options $compareStrictly -Expected $data -Actual $result
161+
}
162+
}
163+
}
164+
124165
Describe "Test PSCustomObject wrapped values are serialized correctly" {
125166
Context "A PSCustomObject containing nested PSCustomObjects" {
126167
It "Should serialize correctly" {

0 commit comments

Comments
 (0)