2010-03-09 00:06:29 +01:00
|
|
|
require("../common");
|
2010-03-08 19:02:19 +01:00
|
|
|
var path = require('path');
|
|
|
|
var fs = require('fs');
|
2010-02-18 09:02:55 +01:00
|
|
|
var got_error = false;
|
|
|
|
var success_count = 0;
|
|
|
|
|
2010-02-20 01:02:30 +01:00
|
|
|
var file = path.join(fixturesDir, "a.js");
|
2010-02-18 09:02:55 +01:00
|
|
|
|
2010-02-20 01:02:30 +01:00
|
|
|
fs.chmod(file, 0777, function (err) {
|
|
|
|
if (err) {
|
|
|
|
got_error = true;
|
|
|
|
} else {
|
|
|
|
puts(fs.statSync(file).mode);
|
|
|
|
assert.equal(0777, fs.statSync(file).mode & 0777);
|
|
|
|
|
|
|
|
fs.chmodSync(file, 0644);
|
|
|
|
assert.equal(0644, fs.statSync(file).mode & 0777);
|
|
|
|
success_count++;
|
|
|
|
}
|
2010-02-18 09:02:55 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
process.addListener("exit", function () {
|
|
|
|
assert.equal(1, success_count);
|
|
|
|
assert.equal(false, got_error);
|
|
|
|
});
|
|
|
|
|