@@ -63,6 +63,12 @@ public enum TestSByteEnum : sbyte {
6363 }
6464
6565 $testCases = @ (
66+ @ {
67+ Name = " Can process bool type 'fhx -InputObject `$ true'"
68+ InputObject = $true
69+ Count = 1
70+ ExpectedResult = " 00000000 01 00 00 00"
71+ }
6672 @ {
6773 Name = " Can process byte type 'fhx -InputObject [byte]5'"
6874 InputObject = [byte ]5
@@ -159,6 +165,12 @@ public enum TestSByteEnum : sbyte {
159165 }
160166
161167 $testCases = @ (
168+ @ {
169+ Name = " Can process bool type '`$ true | fhx'"
170+ InputObject = $true
171+ Count = 1
172+ ExpectedResult = " 0000000000000000 01"
173+ }
162174 @ {
163175 Name = " Can process byte type '[byte]5 | fhx'"
164176 InputObject = [byte ]5
@@ -227,6 +239,13 @@ public enum TestSByteEnum : sbyte {
227239 ExpectedResult = " 0000000000000000 F1 12 15 FB ñ��û"
228240 ExpectedSecondResult = " 0000000000000000 01 02 03 04 05 06 ������"
229241 }
242+ @ {
243+ Name = " Can process jagged array type '[bool[]](`$ true, `$ false), [int[]](1, 2, 3, 4) | fhx'"
244+ InputObject = [bool []]($true , $false ), [int []](1 , 2 , 3 , 4 )
245+ Count = 2
246+ ExpectedResult = " 0000000000000000 01 00 00 00 00 00 00 00 �"
247+ ExpectedSecondResult = " 0000000000000000 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 � � � �"
248+ }
230249 @ {
231250 Name = " Can process PS-native enum array '[TestEnum[]]('TestOne', 'TestTwo', 'TestThree', 'TestFour') | fhx'"
232251 InputObject = [TestEnum []](' TestOne' , ' TestTwo' , ' TestThree' , ' TestFour' )
@@ -291,6 +310,19 @@ public enum TestSByteEnum : sbyte {
291310 " System.UInt16[]"
292311 ).ForEach { [regex ]::Escape($_ ) } -join ' |'
293312 }
313+ @ {
314+ InputScript = { $true , $false , $true , 123 , 100 , 76 , $true , $false }
315+ Count = 3
316+ ExpectedResults = @ (
317+ " 0000000000000000 01 00 00 00 00 00 00 00 01 00 00 00 � �"
318+ " 0000000000000000 7B 00 00 00 64 00 00 00 4C 00 00 00 { d L"
319+ " 0000000000000000 01 00 00 00 00 00 00 00 �"
320+ )
321+ ExpectedLabels = @ (
322+ " System.Boolean"
323+ " System.Int32"
324+ ).ForEach { [regex ]::Escape($_ ) } -join ' |'
325+ }
294326 )
295327
296328 It ' can process jagged input: <InputScript>' - TestCases $heterogenousInputCases {
@@ -356,8 +388,7 @@ public enum TestSByteEnum : sbyte {
356388
357389 if ($PathCase ) {
358390 $result = Format-Hex - Path $Path
359- }
360- else {
391+ } else {
361392 # LiteralPath
362393 $result = Format-Hex - LiteralPath $Path
363394 }
@@ -380,8 +411,7 @@ public enum TestSByteEnum : sbyte {
380411 $Result.Bytes [-1 ] | Should - Be 0x0A
381412 $Result.Bytes [-2 ] | Should - Be 0x0D
382413 $Result.Bytes.Length | Should - Be 14
383- }
384- else {
414+ } else {
385415 $Result.Bytes [-1 ] | Should - Be 0x0A
386416 $Result.Bytes.Length | Should - Be 13
387417 }
@@ -507,8 +537,7 @@ public enum TestSByteEnum : sbyte {
507537
508538 if ($PathCase ) {
509539 $output = Format-Hex - Path $InvalidPath , $inputFile1 - ErrorVariable errorThrown - ErrorAction SilentlyContinue
510- }
511- else {
540+ } else {
512541 # LiteralPath
513542 $output = Format-Hex - LiteralPath $InvalidPath , $inputFile1 - ErrorVariable errorThrown - ErrorAction SilentlyContinue
514543 }
0 commit comments