Skip to content

Commit 62175ce

Browse files
committed
Fix failed tests
1 parent 080e42c commit 62175ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dsc/tests/dsc_functions.tests.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,18 +740,20 @@ Describe 'tests for function expressions' {
740740
}
741741

742742
It 'base64ToString function error handling: <expression>' -TestCases @(
743-
@{ expression = '[base64ToString("invalid!@#")]'; expectedError = 'Invalid base64 encoding' }
744-
@{ expression = '[base64ToString("/w==")]'; expectedError = 'Decoded bytes do not form valid UTF-8' }
743+
@{ expression = "[base64ToString('invalid!@#')]" ; expectedError = 'Invalid base64 encoding' }
744+
@{ expression = "[base64ToString('/w==')]" ; expectedError = 'Decoded bytes do not form valid UTF-8' }
745745
) {
746746
param($expression, $expectedError)
747747

748+
$escapedExpression = $expression -replace "'", "''"
749+
748750
$config_yaml = @"
749751
`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
750752
resources:
751753
- name: Echo
752754
type: Microsoft.DSC.Debug/Echo
753755
properties:
754-
output: "$expression"
756+
output: "$escapedExpression"
755757
"@
756758
$out = dsc -l trace config get -i $config_yaml 2>$TestDrive/error.log
757759
$LASTEXITCODE | Should -Not -Be 0

0 commit comments

Comments
 (0)