Skip to content

Commit

Permalink
GJSLint part of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sannis authored and ry committed Dec 3, 2010
1 parent d3532a4 commit c0d69a4
Show file tree
Hide file tree
Showing 50 changed files with 483 additions and 482 deletions.
16 changes: 8 additions & 8 deletions test/fixtures/a.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
var c = require("./b/c");
var c = require('./b/c');

common.debug("load fixtures/a.js");
common.debug('load fixtures/a.js');

var string = "A";
var string = 'A';

exports.SomeClass = c.SomeClass;

exports.A = function () {
exports.A = function() {
return string;
};

exports.C = function () {
exports.C = function() {
return c.C();
};

exports.D = function () {
exports.D = function() {
return c.D();
};

exports.number = 42;

process.addListener("exit", function () {
string = "A done";
process.addListener('exit', function() {
string = 'A done';
});
22 changes: 11 additions & 11 deletions test/fixtures/b/c.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
var d = require("./d");
var d = require('./d');

var assert = require("assert");
var assert = require('assert');

var package = require("./package");
var package = require('./package');

assert.equal("world", package.hello);
assert.equal('world', package.hello);

common.debug("load fixtures/b/c.js");
common.debug('load fixtures/b/c.js');

var string = "C";
var string = 'C';

exports.SomeClass = function() {

};

exports.C = function () {
exports.C = function() {
return string;
};

exports.D = function () {
exports.D = function() {
return d.D();
};

process.addListener("exit", function () {
string = "C done";
console.log("b/c.js exit");
process.addListener('exit', function() {
string = 'C done';
console.log('b/c.js exit');
});
10 changes: 5 additions & 5 deletions test/fixtures/b/d.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
common.debug("load fixtures/b/d.js");
common.debug('load fixtures/b/d.js');

var string = "D";
var string = 'D';

exports.D = function () {
exports.D = function() {
return string;
};

process.addListener("exit", function () {
string = "D done";
process.addListener('exit', function() {
string = 'D done';
});

4 changes: 2 additions & 2 deletions test/fixtures/b/package/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
exports.hello = "world";
common.debug("load package/index.js");
exports.hello = 'world';
common.debug('load package/index.js');
8 changes: 4 additions & 4 deletions test/fixtures/child_process_should_emit_error.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var exec = require('child_process').exec;

[0, 1].forEach(function(i) {
exec('ls', function(err, stdout, stderr) {
console.log(i);
throw new Error('hello world');
});
exec('ls', function(err, stdout, stderr) {
console.log(i);
throw new Error('hello world');
});
});
4 changes: 2 additions & 2 deletions test/fixtures/cycles/folder/foo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

var root = require("./../root");
var root = require('./../root');

exports.hello = function () {
exports.hello = function() {
return root.calledFromFoo();
};
8 changes: 4 additions & 4 deletions test/fixtures/cycles/root.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

var foo = exports.foo = require("./folder/foo");
var foo = exports.foo = require('./folder/foo');

exports.hello = "hello";
exports.sayHello = function () {
exports.hello = 'hello';
exports.sayHello = function() {
return foo.hello();
};
exports.calledFromFoo = function () {
exports.calledFromFoo = function() {
return exports.hello;
};
8 changes: 4 additions & 4 deletions test/fixtures/echo.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
common = require("../common");
common = require('../common');
assert = common.assert;

common.print("hello world\r\n");
common.print('hello world\r\n');

var stdin = process.openStdin();

stdin.addListener("data", function (data) {
stdin.addListener('data', function(data) {
process.stdout.write(data.toString());
});

stdin.addListener("end", function () {
stdin.addListener('end', function() {
process.stdout.end();
});
6 changes: 3 additions & 3 deletions test/fixtures/global/plain.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
foo = "foo";
global.bar = "bar";
foo = 'foo';
global.bar = 'bar';

exports.fooBar = {foo: global.foo, bar:bar};
exports.fooBar = {foo: global.foo, bar: bar};
2 changes: 1 addition & 1 deletion test/fixtures/nested-index/one/hello.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
exports.hello = "hello from one!";
exports.hello = 'hello from one!';

2 changes: 1 addition & 1 deletion test/fixtures/nested-index/two/hello.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
exports.hello = "hello from two!";
exports.hello = 'hello from two!';

20 changes: 10 additions & 10 deletions test/fixtures/net-fd-passing-receiver.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
process.mixin(require("../common"));
net = require("net");
process.mixin(require('../common'));
net = require('net');

path = process.ARGV[2];
greeting = process.ARGV[3];

receiver = net.createServer(function(socket) {
socket.addListener("fd", function(fd) {
socket.addListener('fd', function(fd) {
var peerInfo = process.getpeername(fd);
peerInfo.fd = fd;
var passedSocket = new net.Socket(peerInfo);

passedSocket.addListener("eof", function() {
passedSocket.addListener('eof', function() {
passedSocket.close();
});

passedSocket.addListener("data", function(data) {
passedSocket.send("[echo] " + data);
passedSocket.addListener('data', function(data) {
passedSocket.send('[echo] ' + data);
});
passedSocket.addListener("close", function() {
passedSocket.addListener('close', function() {
receiver.close();
});
passedSocket.send("[greeting] " + greeting);
passedSocket.send('[greeting] ' + greeting);
});
});

/* To signal the test runne we're up and listening */
receiver.addListener("listening", function() {
common.print("ready");
receiver.addListener('listening', function() {
common.print('ready');
});

receiver.listen(path);
10 changes: 6 additions & 4 deletions test/fixtures/print-chars-from-buffer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
common = require("../common");
assert = common.assert
Buffer = require("buffer").Buffer;
common = require('../common');
assert = common.assert;
Buffer = require('buffer').Buffer;

var n = parseInt(process.argv[2]);

b = new Buffer(n);
for (var i = 0; i < n; i++) { b[i] = 100; }
for (var i = 0; i < n; i++) {
b[i] = 100;
}

process.stdout.write(b);
6 changes: 3 additions & 3 deletions test/fixtures/print-chars.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
common = require("../common");
assert = common.assert
common = require('../common');
assert = common.assert;

var n = parseInt(process.argv[2]);

var s = "";
var s = '';
for (var i = 0; i < n; i++) {
s += 'c';
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/recvfd.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function processData(s) {
if (pipeStream.write(JSON.stringify(d) + '\n')) {
drainFunc();
}
};
}

// Create a UNIX socket to the path defined by argv[2] and read a file
// descriptor and misc data from it.
Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/require-path/p1/bar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var path = require("path");
var path = require('path');

require.paths.unshift(path.join(__dirname,"../p2"));
require.paths.unshift(path.join(__dirname, '../p2'));

exports.foo = require("foo");
exports.foo = require('foo');

exports.expect = require(path.join(__dirname, "../p2/bar"));
exports.expect = require(path.join(__dirname, '../p2/bar'));
exports.actual = exports.foo.bar;
2 changes: 1 addition & 1 deletion test/fixtures/require-path/p1/foo.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require.paths.unshift(__dirname);
exports.bar = require("bar");
exports.bar = require('bar');
2 changes: 1 addition & 1 deletion test/fixtures/require-path/p2/foo.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require.paths.unshift(__dirname);
exports.bar = require("bar"); // surprise! this is not /p2/bar, this is /p1/bar
exports.bar = require('bar'); // surprise! this is not /p2/bar, this is /p1/bar
6 changes: 3 additions & 3 deletions test/fixtures/should_exit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function tmp() {}
process.addListener("SIGINT", tmp);
process.removeListener("SIGINT", tmp);
setInterval(function () {
process.addListener('SIGINT', tmp);
process.removeListener('SIGINT', tmp);
setInterval(function() {
process.stdout.write('keep alive\n');
}, 1000);
2 changes: 1 addition & 1 deletion test/fixtures/stdio-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var replacement = process.argv[3];
var re = new RegExp(regexIn, 'g');
var stdin = process.openStdin();

stdin.addListener("data", function (data) {
stdin.addListener('data', function(data) {
data = data.toString();
process.stdout.write(data.replace(re, replacement));
});
2 changes: 1 addition & 1 deletion test/fixtures/throws_error.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
throw new Error("blah");
throw new Error('blah');
2 changes: 1 addition & 1 deletion test/fixtures/throws_error1.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
throw new Error("blah");
throw new Error('blah');
2 changes: 1 addition & 1 deletion test/fixtures/throws_error3.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
process.nextTick(function () {
process.nextTick(function() {
JSON.parse(undefined);
});
88 changes: 44 additions & 44 deletions test/message/2100bytes.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
common = require("../common");
assert = common.assert
common = require('../common');
assert = common.assert;

util = require('util');
console.log([
'_______________________________________________50',
'______________________________________________100',
'______________________________________________150',
'______________________________________________200',
'______________________________________________250',
'______________________________________________300',
'______________________________________________350',
'______________________________________________400',
'______________________________________________450',
'______________________________________________500',
'______________________________________________550',
'______________________________________________600',
'______________________________________________650',
'______________________________________________700',
'______________________________________________750',
'______________________________________________800',
'______________________________________________850',
'______________________________________________900',
'______________________________________________950',
'_____________________________________________1000',
'_____________________________________________1050',
'_____________________________________________1100',
'_____________________________________________1150',
'_____________________________________________1200',
'_____________________________________________1250',
'_____________________________________________1300',
'_____________________________________________1350',
'_____________________________________________1400',
'_____________________________________________1450',
'_____________________________________________1500',
'_____________________________________________1550',
'_____________________________________________1600',
'_____________________________________________1650',
'_____________________________________________1700',
'_____________________________________________1750',
'_____________________________________________1800',
'_____________________________________________1850',
'_____________________________________________1900',
'_____________________________________________1950',
'_____________________________________________2000',
'_____________________________________________2050',
'_____________________________________________2100',
'_______________________________________________50',
'______________________________________________100',
'______________________________________________150',
'______________________________________________200',
'______________________________________________250',
'______________________________________________300',
'______________________________________________350',
'______________________________________________400',
'______________________________________________450',
'______________________________________________500',
'______________________________________________550',
'______________________________________________600',
'______________________________________________650',
'______________________________________________700',
'______________________________________________750',
'______________________________________________800',
'______________________________________________850',
'______________________________________________900',
'______________________________________________950',
'_____________________________________________1000',
'_____________________________________________1050',
'_____________________________________________1100',
'_____________________________________________1150',
'_____________________________________________1200',
'_____________________________________________1250',
'_____________________________________________1300',
'_____________________________________________1350',
'_____________________________________________1400',
'_____________________________________________1450',
'_____________________________________________1500',
'_____________________________________________1550',
'_____________________________________________1600',
'_____________________________________________1650',
'_____________________________________________1700',
'_____________________________________________1750',
'_____________________________________________1800',
'_____________________________________________1850',
'_____________________________________________1900',
'_____________________________________________1950',
'_____________________________________________2000',
'_____________________________________________2050',
'_____________________________________________2100'
].join('\n'));

Loading

0 comments on commit c0d69a4

Please sign in to comment.