read_file.c

ds2.10/fluffos-2.16-ds05/testsuite/single/tests/efuns/read_file.c · 360 B

From the archive ds2.10.zip

Download the archive   « Back to the archive contents

void do_tests() {
    string foo = read_bytes("/testfile");
    string mid = implode(explode(foo, "\n")[99..198], "\n") + "\n";

    ASSERT(!read_file("/single", 10, 10));
    ASSERT(read_file("/testfile") == foo);
    ASSERT(read_file("/testfile", 100, 100) == mid);
    ASSERT(!read_file("/does_not_exist"));
    ASSERT(!read_file("/testfile", 10000, 1));
}

Site Stats

Snippets: 1791
Codebases: 571