You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dsc/tests/dsc_user_functions.tests.ps1
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -74,8 +74,8 @@ resources:
74
74
@{ expression="[reference('foo/bar')]"; errorText="The 'reference()' function is not available in user-defined functions" }
75
75
@{ expression="[utcNow()]"; errorText="The 'utcNow()' function can only be used as a parameter default" }
76
76
@{ expression="[variables('myVar')]"; errorText="The 'variables()' function is not available in user-defined functions" }
77
-
@{ expression="[MyFunction.OtherFunction()]"; errorText="Unknown user function: MyFunction.OtherFunctio" }
78
-
@{ expression="[MyFunction.BadFunction()]"; errorText="Unknown user function: MyFunction.BadFunction" }
77
+
@{ expression="[MyFunction.OtherFunction()]"; errorText="Unknown user function 'MyFunction.OtherFunction'" }
78
+
@{ expression="[MyFunction.BadFunction()]"; errorText="Unknown user function 'MyFunction.BadFunction'" }
79
79
) {
80
80
param($expression,$errorText)
81
81
@@ -130,4 +130,25 @@ resources:
130
130
$LASTEXITCODE| Should -Be 2-Because (Get-Content$testdrive/error.log |Out-String)
131
131
(Get-Content$testdrive/error.log -Raw) | Should -BeLike "*Parameter 'BadParam' not found in context*"-Because (Get-Content$testdrive/error.log |Out-String)
dsc -l trace config get -i $configYaml2>$testdrive/error.log |Out-Null
151
+
$LASTEXITCODE| Should -Be 2-Because (Get-Content$testdrive/error.log |Out-String)
152
+
(Get-Content$testdrive/error.log -Raw) | Should -BeLike "*Output of user function 'MyFunction.BadFunction' returned an integer, but was expected to be of type 'int'*"-Because (Get-Content$testdrive/error.log |Out-String)
0 commit comments