From 2a6305ca11d5c7adfd85cd09f6eebd3ae0bbd881 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 24 Jul 2015 13:11:18 -0700 Subject: [PATCH] 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\-]*$ --- src/monad | 2 +- src/monad-native | 2 +- src/ps_test/test_CorePsPlatform.cs | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/monad b/src/monad index 1a2fa0af4..013dbb254 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 1a2fa0af446bf6adda0400fc54b5529afe58ef19 +Subproject commit 013dbb254f57d72bf6d8fc247cca070c8413ca53 diff --git a/src/monad-native b/src/monad-native index c1c9a9926..7d007d670 160000 --- a/src/monad-native +++ b/src/monad-native @@ -1 +1 @@ -Subproject commit c1c9a992699229cf69ef22a346b95137ab9f7a15 +Subproject commit 7d007d67084ef9a4bce364af05d36a31619066b0 diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index fe2387b43..28be80664 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -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()); + } } }