We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f671c94 commit a289541Copy full SHA for a289541
test/basic.js
@@ -484,6 +484,24 @@ test('pool', function (t) {
484
})
485
486
487
+test('readonly mode', function (t) {
488
+ t.plan(1)
489
+
490
+ const filename = gen()
491
+ const f = new RAF(filename)
492
493
+ f.write(0, Buffer.from('hello world'), function () {
494
+ f.close(function () {
495
+ const r = new RAF(filename, { writable: false })
496
497
+ r.read(0, 5, function (_, data) {
498
+ t.alike(data, Buffer.from('hello'))
499
+ r.close()
500
+ })
501
502
503
+})
504
505
function gen () {
506
return path.join(tmp, ++i + '.txt')
507
}
0 commit comments