Skip to content

Commit 7e30287

Browse files
committed
Use double instead of single quotes in DAP tests
So we can interpolate variables.
1 parent ece47e9 commit 7e30287

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using System;
@@ -136,11 +136,23 @@ private string GenerateScriptFromLoggingStatements(params string[] logStatements
136136
}
137137

138138
// Have script create file first with `>` (but don't rely on overwriting).
139-
StringBuilder builder = new StringBuilder().Append('\'').Append(logStatements[0]).Append("' > '").Append(s_testOutputPath).AppendLine("'");
139+
// NOTE: We uses double quotes so that we can use PowerShell variables.
140+
StringBuilder builder = new StringBuilder()
141+
.Append("Write-Output \"")
142+
.Append(logStatements[0])
143+
.Append("\" > '")
144+
.Append(s_testOutputPath)
145+
.AppendLine("'");
146+
140147
for (int i = 1; i < logStatements.Length; i++)
141148
{
142149
// Then append to that script with `>>`.
143-
builder.Append('\'').Append(logStatements[i]).Append("' >> '").Append(s_testOutputPath).AppendLine("'");
150+
builder
151+
.Append("Write-Output \"")
152+
.Append(logStatements[i])
153+
.Append("\" >> '")
154+
.Append(s_testOutputPath)
155+
.AppendLine("'");
144156
}
145157

146158
_output.WriteLine("Script is:");

0 commit comments

Comments
 (0)