-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix creating OperatingSystem with PlatformID.Other #39130
Conversation
Creating an OperatingSystem with PlatformID.Other would result in an exception about an unexpected enum value. dotnet#38790 was missing some tests that verified this behavior.
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test validating that other is returned on browser?
@stephentoub there was one in System.Runtime.Extensions and it was actually failing but we're not running it on CI until #38996 is merged. I fixed it to verify the expected value and tested locally. |
1e101d6
to
a92304e
Compare
@@ -65,6 +65,7 @@ public string VersionString | |||
case PlatformID.Unix: os = "Unix "; break; | |||
case PlatformID.Xbox: os = "Xbox "; break; | |||
case PlatformID.MacOSX: os = "Mac OS X "; break; | |||
case PlatformID.Other: os = "Other"; break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need a space after it? The others have a space before the version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting this, opened #39180.
Creating an OperatingSystem with PlatformID.Other would result in an exception about an unexpected enum value.
#38790 was missing some tests that verified this behavior.