Add passing GetUserName unit test

Updates monad-native submodule to include GetUserName P/Invoke, and
updates monad submodule to use said P/Invoke.

Matches the username against ^[a-z][a-z0-9\-]*$
This commit is contained in:
Andrew Schwartzmeyer 2015-07-24 13:11:18 -07:00
parent f86f856ba6
commit 2a6305ca11
3 changed files with 10 additions and 2 deletions

@ -1 +1 @@
Subproject commit 1a2fa0af446bf6adda0400fc54b5529afe58ef19
Subproject commit 013dbb254f57d72bf6d8fc247cca070c8413ca53

@ -1 +1 @@
Subproject commit c1c9a992699229cf69ef22a346b95137ab9f7a15
Subproject commit 7d007d67084ef9a4bce364af05d36a31619066b0

View file

@ -41,5 +41,13 @@ namespace PSTests
{
Assert.False(Platform.HasRegistrySupport());
}
[Fact]
public static void TestGetUserName()
{
// Use Assert.Equal("yourusername",
// Platform.NonWindowsGetUserName()) to test without regex
Assert.Matches("^[a-z][a-z0-9\\-]*$", Platform.NonWindowsGetUserName());
}
}
}