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.
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.
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.
Incidentally I think this comment is out of date and if (driveName.Contains('\0')) ought to compile.
There was a problem hiding this comment.
Yeah looks like it is outdated but since this is preexisting code I'll leave the cleanup to later on :)
| // 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.
Just curious, this is due to a limitation in the libc that we use in browser?
Some of the VB tests need culture data.
For DriveInfo we provide an implementation for Browser that returns stub values.