{"action":"opened","issue":{"url":"https://api.github.com/repos/System-IO-Abstractions/System.IO.Abstractions/issues/425","repository_url":"https://api.github.com/repos/System-IO-Abstractions/System.IO.Abstractions","labels_url":"https://api.github.com/repos/System-IO-Abstractions/System.IO.Abstractions/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/System-IO-Abstractions/System.IO.Abstractions/issues/425/comments","events_url":"https://api.github.com/repos/System-IO-Abstractions/System.IO.Abstractions/issues/425/events","html_url":"https://github.com/System-IO-Abstractions/System.IO.Abstractions/issues/425","id":391491498,"node_id":"MDU6SXNzdWUzOTE0OTE0OTg=","number":425,"title":"Path normalization doesn't match standard C#'s functionality","user":{"login":"LatteAno","id":23175357,"node_id":"MDQ6VXNlcjIzMTc1MzU3","avatar_url":"https://avatars3.githubusercontent.com/u/23175357?v=4","gravatar_id":"","url":"https://api.github.com/users/LatteAno","html_url":"https://github.com/LatteAno","followers_url":"https://api.github.com/users/LatteAno/followers","following_url":"https://api.github.com/users/LatteAno/following{/other_user}","gists_url":"https://api.github.com/users/LatteAno/gists{/gist_id}","starred_url":"https://api.github.com/users/LatteAno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LatteAno/subscriptions","organizations_url":"https://api.github.com/users/LatteAno/orgs","repos_url":"https://api.github.com/users/LatteAno/repos","events_url":"https://api.github.com/users/LatteAno/events{/privacy}","received_events_url":"https://api.github.com/users/LatteAno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-16T18:14:21Z","updated_at":"2018-12-16T18:14:21Z","closed_at":null,"author_association":"NONE","body":"In the following unit-test, both normal C# methods are consistent with each other, while `MockFileSystem`'s doesn'tL\r\n\r\n```\r\n[TestMethod]\r\npublic void TestPathNormalization() {\r\n\tvar mockFs = new MockFileSystem(new Dictionary<string, MockFileData>());\r\n\tvar vectors = new [] {\r\n\t\tnew {input = @\"c:\\top\\..\\most\\file\", expected = @\"c:\\most\\file\"},\r\n\t\tnew {input = @\"c:\\top\\..\\most\\..\\dir\\file\", expected = @\"c:\\dir\\file\"},\r\n\t\tnew {input = @\"\\file\", expected = @\"c:\\file\"}, // (assuming you're running on c:)\r\n\t\tnew {input = @\"c:\\top\\../..\\most\\file\", expected = @\"c:\\most\\file\"},\r\n\t};\r\n\tforeach (var vector in vectors) {\r\n\t\tvar path = Path.GetFullPath(vector.input);\r\n\t\tvar fileInfo = new FileInfo(vector.input).FullName;\r\n\t\tvar mock = mockFs.FileInfo.FromFileName(vector.input).FullName;\r\n\r\n\t\tAssert.AreEqual(vector.expected, path, true);\r\n\t\tAssert.AreEqual(vector.expected, fileInfo, true);\r\n\t\tAssert.AreEqual(vector.expected, mock, true);\r\n\t}\r\n}\r\n```"}}
{"actor":{"display_login":"LatteAno"}}