This commit is contained in:
tznind
2023-02-25 22:22:13 +00:00
parent c35f956eda
commit 9dcb34eae0

View File

@@ -22,11 +22,12 @@ namespace Terminal.Gui.Core {
{
var dlg = GetInitializedFileDialog ();
Send ('.', ConsoleKey.OemPeriod);
SendSlash ();
// Entering ./ replaces current text with the full path
Assert.Equal (Environment.CurrentDirectory + Path.DirectorySeparatorChar, dlg.Path);
Assert.Equal (
new DirectoryInfo(Environment.CurrentDirectory + Path.DirectorySeparatorChar).FullName,
new DirectoryInfo(dlg.Path + Path.DirectorySeparatorChar).FullName
);
// continue typing the rest of the path
Send ("bob");
@@ -35,7 +36,7 @@ namespace Terminal.Gui.Core {
Assert.True (dlg.Canceled);
SendEnter ();
Send ('\n', ConsoleKey.Enter, false);
Assert.False (dlg.Canceled);
Assert.Equal ("bob.csv", Path.GetFileName (dlg.Path));
}
@@ -92,10 +93,6 @@ namespace Terminal.Gui.Core {
}
}
private void SendEnter ()
{
Application.Driver.SendKeys ('\n', ConsoleKey.Enter, false, false, false);
}
[Fact,AutoInitShutdown]
public void Autocomplete_NoSuggestion_WhenTextMatchesExactly ()