File tree 2 files changed +32
-0
lines changed
PowerShellEditorServices.Test/Debugging
PowerShellEditorServices.Test.Shared/Debugging
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -51,3 +51,19 @@ $sortedDictionary['blue'] = 'red'
51
51
52
52
# This is a dummy function that the test will use to stop and evaluate the debug environment
53
53
function __BreakDebuggerDerivedDictionaryPropertyInRawView {}; __BreakDebuggerDerivedDictionaryPropertyInRawView
54
+
55
+ class CustomToString {
56
+ [String ]$String = ' Hello'
57
+ [String ]ToString() {
58
+ return $this.String.ToUpper ()
59
+ }
60
+ }
61
+ $SCRIPT :CustomToStrings = 1 .. 1000 | ForEach-Object {
62
+ [CustomToString ]::new()
63
+ }
64
+ $SCRIPT :Small = $SCRIPT :CustomToStrings [1 .. 10 ]
65
+ $SCRIPT :Medium = $SCRIPT :CustomToStrings [1 .. 50 ]
66
+ $SCRIPT :Large = $SCRIPT :CustomToStrings [1 .. 100 ]
67
+
68
+ # This is a dummy function that the test will use to stop and evaluate the debug environment
69
+ function __BreakDebuggerToStringShouldMarshallToPipeline {}; __BreakDebuggerToStringShouldMarshallToPipeline
Original file line number Diff line number Diff line change @@ -1144,5 +1144,21 @@ await debugService.SetCommandBreakpointsAsync(
1144
1144
Assert . Contains ( childVars , i => i . Name is "Exists" && i . ValueString is "$true" ) ;
1145
1145
Assert . Contains ( childVars , i => i . Name is "LastAccessTime" ) ;
1146
1146
}
1147
+
1148
+
1149
+ // Verifies Issue #1686
1150
+ [ Fact ]
1151
+ public async Task DebuggerToStringShouldMarshallToPipeline ( )
1152
+ {
1153
+ CommandBreakpointDetails breakpoint = CommandBreakpointDetails . Create ( "__BreakDebuggerToStringShouldMarshallToPipeline" ) ;
1154
+ await debugService . SetCommandBreakpointsAsync ( new [ ] { breakpoint } ) . ConfigureAwait ( true ) ;
1155
+
1156
+ // Execute the script and wait for the breakpoint to be hit
1157
+ Task _ = ExecuteVariableScriptFileAsync ( ) ;
1158
+ AssertDebuggerStopped ( commandBreakpointDetails : breakpoint ) ;
1159
+
1160
+ VariableDetailsBase [ ] childVars = await GetVariables ( VariableContainerDetails . ScriptScopeName ) . ConfigureAwait ( true ) ;
1161
+ Assert . Contains ( childVars , i => i . Name is "$CustomToStrings" ) ;
1162
+ }
1147
1163
}
1148
1164
}
You can’t perform that action at this time.
0 commit comments