var fd = use('fd')
var time = use('time')

return {
    test_cat: function() {
        var tmp = "cat_test.tmp"
        var f = fd.open(tmp, 'w')
        fd.write(f, "Hello world")
        fd.close(f)

        var st = time.number()
        var f2 = fd.open(tmp, 'r')
        var stat = fd.fstat(f2)
        var data = fd.read(f2, stat.size);
        fd.close(f2)
        log.console(`cat took ${time.number()-st}`)

        stone(data)
        if (data.read_text(0) != "Hello world") disrupt

        fd.unlink(tmp)
    }
}
