提交 a530f3f7 编写于 作者: M Manish Jayaswal

Incorporating CR feedback

上级 75f48eaf
......@@ -335,6 +335,9 @@ private void PendSubmissions(IEnumerable<PendingSubmission> inputs)
public void AddInput(string command)
{
// If the language buffer is readonly then input can not be added. Return immediately.
// The language buffer gets marked as readonly in SubmitAsync method when input on the prompt
// gets submitted. So it would be readonly when the user types #reset on the prompt. In that
// case it is the right thing to bail out of this method.
if (_window._currentLanguageBuffer != null && _window._currentLanguageBuffer.IsReadOnly(0))
{
return;
......
......@@ -55,12 +55,9 @@ public static ITextSnapshot MockSnapshot(string content)
return snapshotMock.Object;
}
public string GetTextFromCurrentLanguageBuffer
public string GetTextFromCurrentLanguageBuffer()
{
get
{
return Window.CurrentLanguageBuffer.CurrentSnapshot.GetText();
}
return Window.CurrentLanguageBuffer.CurrentSnapshot.GetText();
}
#endregion
......@@ -621,23 +618,23 @@ private void AssertCaretVirtualPosition(int expectedLine, int expectedColumn)
[Fact]
public void CheckHistoryPrevious()
{
const string V = "1 ";
Window.InsertCode(V);
Assert.Equal(V, GetTextFromCurrentLanguageBuffer);
const string inputString = "1 ";
Window.InsertCode(inputString);
Assert.Equal(inputString, GetTextFromCurrentLanguageBuffer());
Task.Run(() => Window.Operations.ExecuteInput()).PumpingWait();
Window.Operations.HistoryPrevious();
Assert.Equal(V, GetTextFromCurrentLanguageBuffer);
Assert.Equal(inputString, GetTextFromCurrentLanguageBuffer());
}
[Fact]
public void CheckHistoryPreviousAfterReset()
{
const string V = "#reset";
Window.InsertCode(V);
Assert.Equal(V, GetTextFromCurrentLanguageBuffer);
const string resetCommand = "#reset";
Window.InsertCode(resetCommand);
Assert.Equal(resetCommand, GetTextFromCurrentLanguageBuffer());
Task.Run(() => Window.Operations.ExecuteInput()).PumpingWait();
Window.Operations.HistoryPrevious();
Assert.Equal(V, GetTextFromCurrentLanguageBuffer);
Assert.Equal(resetCommand, GetTextFromCurrentLanguageBuffer());
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册