Commit 19fb42e9 19fb42e9d9000e8be0d4c5b067d276d521fb1644 by Nicolas Perriault

fixes invalid sort function in Tester.findTestFiles()

1 parent 9f223cf7
...@@ -394,9 +394,7 @@ var Tester = function(casper, options) { ...@@ -394,9 +394,7 @@ var Tester = function(casper, options) {
394 }); 394 });
395 return entries.filter(function(entry) { 395 return entries.filter(function(entry) {
396 return utils.isJsFile(fs.absolute(fs.pathJoin(dir, entry))); 396 return utils.isJsFile(fs.absolute(fs.pathJoin(dir, entry)));
397 }).sort(function(a, b) { 397 }).sort();
398 return a > b;
399 });
400 }; 398 };
401 399
402 /** 400 /**
......
1 var fs = require('fs');
2
1 var t = casper.test; 3 var t = casper.test;
2 4
3 t.comment('Tester.testEquals()'); 5 t.comment('Tester.testEquals()');
...@@ -24,4 +26,17 @@ t.assertNot(t.testEquals({1:{name:"bob",age:28}, 2:{name:"john",age:26}}, {1:{na ...@@ -24,4 +26,17 @@ t.assertNot(t.testEquals({1:{name:"bob",age:28}, 2:{name:"john",age:26}}, {1:{na
24 t.assert(t.testEquals(function(x){return x;}, function(x){return x;}), 'Tester.testEquals() function equality'); 26 t.assert(t.testEquals(function(x){return x;}, function(x){return x;}), 'Tester.testEquals() function equality');
25 t.assertNot(t.testEquals(function(x){return x;}, function(y){return y+2;}), 'Tester.testEquals() function inequality'); 27 t.assertNot(t.testEquals(function(x){return x;}, function(y){return y+2;}), 'Tester.testEquals() function inequality');
26 28
29 t.comment('Tester.sortFiles()');
30 var files = t.findTestFiles(fs.pathJoin(phantom.casperPath, 'tests', 'testdir'));
31 t.assertEquals(files, [
32 "/Users/niko/Sites/casperjs/tests/testdir/01_a/abc.js",
33 "/Users/niko/Sites/casperjs/tests/testdir/01_a/def.js",
34 "/Users/niko/Sites/casperjs/tests/testdir/02_b/ABC.js",
35 "/Users/niko/Sites/casperjs/tests/testdir/02_b/abc.js",
36 "/Users/niko/Sites/casperjs/tests/testdir/03_a.js",
37 "/Users/niko/Sites/casperjs/tests/testdir/03_b.js",
38 "/Users/niko/Sites/casperjs/tests/testdir/04/01_init.js",
39 "/Users/niko/Sites/casperjs/tests/testdir/04/02_do.js"
40 ], 'findTestFiles() find test files and sort them');
41
27 t.done(); 42 t.done();
......
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed