Sandbox.shouldEqualLines

read a file in the test sandbox and verify its contents

struct Sandbox
void
shouldEqualLines
const @trusted
(
in string fileName
,
in string[] lines
,
string file = __FILE__
,
size_t line = __LINE__
)

Examples

1 with(immutable Sandbox()) {
2     import unit_threaded.should;
3 
4     writeFile("lines.txt", ["foo", "toto"]);
5     shouldEqualLines("lines.txt", ["foo", "bar"]).shouldThrow;
6     shouldEqualLines("lines.txt", ["foo", "toto"]);
7 }

Meta