Browse Source

more stringent tests

better-aggressive
Rich-Harris 9 years ago
parent
commit
8410826b7f
  1. 2
      test/function/skips-dead-branches-b/_config.js
  2. 5
      test/function/skips-dead-branches-b/main.js
  3. 2
      test/function/skips-dead-branches-c/_config.js
  4. 5
      test/function/skips-dead-branches-c/main.js
  5. 2
      test/function/skips-dead-branches-d/_config.js
  6. 5
      test/function/skips-dead-branches-d/main.js
  7. 2
      test/function/skips-dead-branches-e/_config.js
  8. 5
      test/function/skips-dead-branches-e/main.js
  9. 2
      test/function/skips-dead-branches/_config.js
  10. 5
      test/function/skips-dead-branches/main.js

2
test/function/skips-dead-branches-b/_config.js

@ -3,6 +3,6 @@ var assert = require( 'assert' );
module.exports = {
description: 'skips a dead branch (b)',
code: function ( code ) {
assert.equal( code.indexOf( 'function foo' ), -1, code );
assert.equal( code.indexOf( 'obj.foo = function' ), -1, code );
}
}

5
test/function/skips-dead-branches-b/main.js

@ -1,4 +1,5 @@
function foo () {
var obj = {};
obj.foo = function () {
console.log( 'this should be excluded' );
}
@ -7,4 +8,4 @@ function bar () {
}
if ( true ) bar();
else foo();
else obj.foo();

2
test/function/skips-dead-branches-c/_config.js

@ -3,6 +3,6 @@ var assert = require( 'assert' );
module.exports = {
description: 'skips a dead branch (c)',
code: function ( code ) {
assert.equal( code.indexOf( 'function foo' ), -1, code );
assert.equal( code.indexOf( 'obj.foo = function' ), -1, code );
}
}

5
test/function/skips-dead-branches-c/main.js

@ -1,4 +1,5 @@
function foo () {
var obj = {};
obj.foo = function () {
console.log( 'this should be excluded' );
}
@ -6,5 +7,5 @@ function bar () {
console.log( 'this should be included' );
}
if ( !true ) foo();
if ( !true ) obj.foo();
bar();

2
test/function/skips-dead-branches-d/_config.js

@ -3,6 +3,6 @@ var assert = require( 'assert' );
module.exports = {
description: 'skips a dead branch (c)',
code: function ( code ) {
assert.equal( code.indexOf( 'function foo' ), -1, code );
assert.equal( code.indexOf( 'obj.foo = function' ), -1, code );
}
}

5
test/function/skips-dead-branches-d/main.js

@ -1,4 +1,5 @@
function foo () {
var obj = {};
obj.foo = function () {
console.log( 'this should be excluded' );
}
@ -6,5 +7,5 @@ function bar () {
console.log( 'this should be included' );
}
if ( 'development' === 'production' ) foo();
if ( 'development' === 'production' ) obj.foo();
bar();

2
test/function/skips-dead-branches-e/_config.js

@ -3,6 +3,6 @@ var assert = require( 'assert' );
module.exports = {
description: 'skips a dead branch (c)',
code: function ( code ) {
assert.equal( code.indexOf( 'function foo' ), -1, code );
assert.equal( code.indexOf( 'obj.foo = function' ), -1, code );
}
}

5
test/function/skips-dead-branches-e/main.js

@ -1,4 +1,5 @@
function foo () {
var obj = {};
obj.foo = function () {
console.log( 'this should be excluded' );
}
@ -6,5 +7,5 @@ function bar () {
console.log( 'this should be included' );
}
if ( 'production' !== 'production' ) foo();
if ( 'production' !== 'production' ) obj.foo();
bar();

2
test/function/skips-dead-branches/_config.js

@ -3,6 +3,6 @@ var assert = require( 'assert' );
module.exports = {
description: 'skips a dead branch',
code: function ( code ) {
assert.equal( code.indexOf( 'function foo' ), -1, code );
assert.equal( code.indexOf( 'obj.foo = function' ), -1, code );
}
}

5
test/function/skips-dead-branches/main.js

@ -1,4 +1,5 @@
function foo () {
var obj = {};
obj.foo = function () {
console.log( 'this should be excluded' );
}
@ -6,5 +7,5 @@ function bar () {
console.log( 'this should be included' );
}
if ( false ) foo();
if ( false ) obj.foo();
else bar();

Loading…
Cancel
Save