File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -585,6 +585,42 @@ bar -h i `
585
585
Should - Be " $expected "
586
586
}
587
587
588
+ It " Should fix script when a parameter value is a script block spanning multiple lines" {
589
+ $def = {foo {
590
+ bar
591
+ } - baz}
592
+
593
+ $expected = {foo {
594
+ bar
595
+ } - baz}
596
+ Invoke-Formatter - ScriptDefinition " $def " - Settings $settings |
597
+ Should - Be " $expected "
598
+ }
599
+
600
+ It " Should fix script when a parameter value is a hashtable spanning multiple lines" {
601
+ $def = {foo @ {
602
+ a = 1
603
+ } - baz}
604
+
605
+ $expected = {foo @ {
606
+ a = 1
607
+ } - baz}
608
+ Invoke-Formatter - ScriptDefinition " $def " - Settings $settings |
609
+ Should - Be " $expected "
610
+ }
611
+
612
+ It " Should fix script when a parameter value is an array spanning multiple lines" {
613
+ $def = {foo @ (
614
+ 1
615
+ ) - baz}
616
+
617
+ $expected = {foo @ (
618
+ 1
619
+ ) - baz}
620
+ Invoke-Formatter - ScriptDefinition " $def " - Settings $settings |
621
+ Should - Be " $expected "
622
+ }
623
+
588
624
It " Should fix script when redirects are involved and whitespace is not consistent" {
589
625
# Related to Issue #2000
590
626
$def = ' foo 3>&1 1>$null 2>&1'
You can’t perform that action at this time.
0 commit comments