Fixes #1251. Fixes TextValidateProvider exception on the All View Tester scenario. (#1252)

This commit is contained in:
BDisp
2021-04-27 16:56:46 +01:00
committed by GitHub
parent 91d5ff41b2
commit 761224cf77
2 changed files with 99 additions and 9 deletions

View File

@@ -392,17 +392,15 @@ namespace Terminal.Gui.Views {
}
[Fact]
public void Empty_Mask_Validates_Everything ()
public void Empty_Mask_Does_Not_Validate ()
{
// Maybe it's not the right behaviour.
var field = new TextValidateField<TextRegexProvider> () {
Width = 20
};
field.ProcessKey (new KeyEvent (Key.D1, new KeyModifiers { }));
Assert.Equal ("1", field.Text);
Assert.True (field.IsValid);
field.ProcessKey (new KeyEvent (Key.D1, new KeyModifiers ()));
Assert.Equal ("", field.Text);
Assert.False (field.IsValid);
}
[Fact]