Skip to content

MockFileSystem consistency issue with slash/backslash paths on Windows #405

@EmilianoElMariachi

Description

@EmilianoElMariachi

MockFileSystem is not consistent under Windows.

var fs = new MockFileSystem();
fs.AddFile(@"c:\d1\d2\file.txt", new MockFileData("Hello"));

Console.WriteLine(fs.Directory.GetFiles("c:/d1/d2/").Length); // Prints "0": not correct
Console.WriteLine(fs.File.Exists("c:/d1/d2/file.txt")); // Prints "true": correct but not consistent with GetFiles

Under Windows, directory paths are considered equals whatever they are written with slashes of backslashes.

Was working fine in 2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: in workIssues that are currently worked ontype: bugIssues that describe misbehaving functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions