When enumerating files, the files should be returned in a sequence using full path and file name.
For the Test implementation, it seems to return each file as two entries; one with filename only, and one with last directory and filename.
var path = "c:\\dir\\subdir";
var expected = Path.Combine(path, "file");
var computation =
from dir in Directory<Runtime>.create(path)
from file in File<Runtime>.writeAllText(expected, string.Empty)
from files in Directory<Runtime>.enumerateFiles(path)
select files;
var actual = (await computation.Run(Runtime.New()))
.ThrowIfFail();
Assert.That(actual, Is.EquivalentTo(Seq1(expected)));
I get this result:
Assert.That(actual, Is.EquivalentTo(Seq1(expected)))
Expected: equivalent to < "c:\dir\subdir\file" >
But was: < "subdir\file", "file" >
Missing (1): < "c:\dir\subdir\file" >
Extra (2): < "file", "subdir\file" >
When enumerating files, the files should be returned in a sequence using full path and file name. For the Test implementation, it seems to return each file as two entries; one with filename only, and one with last directory and filename.
Source in Microsoft docs: https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.enumeratefiles?view=net-7.0#system-io-directory-enumeratefiles(system-string-system-string)
Repro:
I get this result: