-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
WASM: Fix System.IO.FileSystem.DriveInfo and Microsoft.VisualBasic.Core tests #39276
WASM: Fix System.IO.FileSystem.DriveInfo and Microsoft.VisualBasic.Core tests #39276
Conversation
Some tests need culture data.
30bf384
to
080e22c
Compare
public sealed partial class DriveInfo | ||
{ | ||
public DriveType DriveType => DriveType.Unknown; | ||
public string DriveFormat => "memfs"; |
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.
I see "memfs" is a node.js plugin. Is this the value that I would get in the browser context, where node.js is not present - would that be confusing?
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.
memfs
is the default Emscripten file system that we're using to emulate an FS in the browser: https://emscripten.org/docs/api_reference/Filesystem-API.html
|
||
private static string NormalizeDriveName(string driveName) | ||
{ | ||
if (driveName.Contains("\0")) // string.Contains(char) is .NetCore2.1+ specific |
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.
Incidentally I think this comment is out of date and if (driveName.Contains('\0'))
ought to compile.
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.
Yeah looks like it is outdated but since this is preexisting code I'll leave the cleanup to later on :)
@@ -13,7 +13,7 @@ public class FinancialTests | |||
|
|||
// The accuracy to which we can validate some numeric test cases depends on the platform. | |||
private static readonly int s_precision = IsArmOrArm64OrAlpine ? 12 : | |||
PlatformDetection.IsNetFramework ? 14 : 15; | |||
(PlatformDetection.IsBrowser || PlatformDetection.IsNetFramework) ? 14 : 15; |
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.
Just curious, this is due to a limitation in the libc that we use in browser?
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.
Yes.
Some of the VB tests need culture data.
For DriveInfo we provide an implementation for Browser that returns stub values.