提交 ab1b4fcf 编写于 作者: A Artur Spychaj

Split #r commands to improve error handling

上级 fdfe5f43
......@@ -104,11 +104,12 @@ internal Task Execute(IInteractiveWindow interactiveWindow, string title)
await interactiveEvaluator.SetPathsAsync(referenceSearchPaths, sourceSearchPaths, projectDirectory).ConfigureAwait(true);
}
await interactiveWindow.SubmitAsync(new[]
var importReferencesCommand = referencePaths.Select(_createReference);
var importNamespacesCommand = namespacesToImport.Select(_createImport).Join("\r\n");
await interactiveWindow.SubmitAsync(importReferencesCommand.Concat(new[]
{
referencePaths.Select(_createReference).Join("\r\n"),
namespacesToImport.Select(_createImport).Join("\r\n")
}).ConfigureAwait(true);
importNamespacesCommand
})).ConfigureAwait(true);
}
/// <summary>
......
......@@ -37,9 +37,9 @@ public async void TestResetREPLWithProjectContext()
Assert.True(replReferenceCommands.Any(rc => rc.EndsWith(@"ResetInteractiveTestsAssembly.dll""")));
Assert.True(replReferenceCommands.Any(rc => rc.EndsWith(@"ResetInteractiveVisualBasicSubproject.dll""")));
var expectedSubmissions = new List<string> {
string.Join("\r\n", replReferenceCommands) + "\r\n",
string.Join("\r\n", @"using ""ns1"";", @"using ""ns2"";") + "\r\n"};
var expectedSubmissions = new List<string>();
expectedSubmissions.AddRange(replReferenceCommands.Select(r => r + "\r\n"));
expectedSubmissions.Add(string.Join("\r\n", @"using ""ns1"";", @"using ""ns2"";") + "\r\n");
AssertResetInteractive(workspace, project, buildSucceeds: true, expectedSubmissions: expectedSubmissions);
// Test that no submissions are executed if the build fails.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册