On Friday, 18 May 2018 at 15:16:52 UTC, Russel Winder wrote:
Hi,

What's the current official position on how to create temporary files for use during a unittest. I found

Not official, but...

    import unit_threaded;

    with(const Sandbox()) {
        writeFile("myfile.txt", "contents");
        shouldExist("myfile.txt");
        shouldEqualContent("myfile.txt", "contents");
        fileShouldContain("myfile.txt", "cont");
    }

Atila

Reply via email to