文件操作 - test.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/atom/resources/app/apm/node_modules/to-buffer/test.js
编辑文件内容
var tape = require('tape') var toBuffer = require('./') tape('buffer returns buffer', function (t) { t.same(toBuffer(Buffer('hi')), Buffer('hi')) t.end() }) tape('string returns buffer', function (t) { t.same(toBuffer('hi'), Buffer('hi')) t.end() }) tape('string + enc returns buffer', function (t) { t.same(toBuffer('6869', 'hex'), Buffer('hi')) t.end() }) tape('other input throws', function (t) { try { toBuffer(42) } catch (err) { t.same(err.message, 'Input should be a buffer or a string') t.end() } })
修改文件时间
将文件时间修改为当前时间的前一年
删除文件