mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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:
+1
-1
Submodule src/monad updated: 1a2fa0af44...013dbb254f
+1
-1
Submodule src/monad-native updated: c1c9a99269...7d007d6708
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user