@@ -695,23 +695,21 @@ Describe 'tests for function expressions' {
695695 $out.results [0 ].result.actualState.output | Should - Be $expected
696696 }
697697
698- # type validation is done on system-level
699698 It ' substring function error handling: <expression>' - TestCases @ (
700- @ { expression = ' [substring(" hello" , -1, 2)]' ; expectedError = ' Start index cannot be negative' }
701- @ { expression = ' [substring(" hello" , 1, -1)]' ; expectedError = ' Length cannot be negative' }
702- @ { expression = ' [substring(" hello" , 10, 1)]' ; expectedError = ' Start index is beyond the end of the string' }
703- @ { expression = ' [substring(" hello" , 2, 10)]' ; expectedError = ' Length extends beyond the end of the string' }
699+ @ { expression = " [substring(' hello' , -1, 2)]" ; expectedError = ' Start index cannot be negative' }
700+ @ { expression = " [substring(' hello' , 1, -1)]" ; expectedError = ' Length cannot be negative' }
701+ @ { expression = " [substring(' hello' , 10, 1)]" ; expectedError = ' Start index is beyond the end of the string' }
702+ @ { expression = " [substring(' hello' , 2, 10)]" ; expectedError = ' Length extends beyond the end of the string' }
704703 ) {
705704 param ($expression , $expectedError )
706705
707- $escapedExpression = $expression -replace " '" , " ''"
708706 $config_yaml = @"
709707 `$ schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
710708 resources:
711709 - name: Echo
712710 type: Microsoft.DSC.Debug/Echo
713711 properties:
714- output: ' $escapedExpression '
712+ output: `" $expression `"
715713"@
716714 $out = dsc - l trace config get - i $config_yaml 2> $TestDrive / error.log
717715 $LASTEXITCODE | Should -Not - Be 0
0 commit comments