File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -585,6 +585,42 @@ bar -h i `
585585 Should - Be " $expected "
586586 }
587587
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+
588624 It " Should fix script when redirects are involved and whitespace is not consistent" {
589625 # Related to Issue #2000
590626 $def = ' foo 3>&1 1>$null 2>&1'
You can’t perform that action at this time.
0 commit comments