Browse Source

update test to reflect bug accurately

contingency-plan
Rich-Harris 9 years ago
parent
commit
fddf71d4a8
  1. 5
      test/function/functions-renamed-correctly/_config.js
  2. 5
      test/function/functions-renamed-correctly/after.js
  3. 5
      test/function/functions-renamed-correctly/before.js
  4. 7
      test/function/functions-renamed-correctly/factorial.js
  5. 7
      test/function/functions-renamed-correctly/main.js
  6. 9
      test/function/shadowed-exported-var/_config.js
  7. 9
      test/function/shadowed-exported-var/main.js

5
test/function/functions-renamed-correctly/_config.js

@ -0,0 +1,5 @@
module.exports = {
description: 'renames function expression IDs correctly',
show: true,
solo: true
};

5
test/function/functions-renamed-correctly/after.js

@ -0,0 +1,5 @@
function x () {
console.log( 'after' );
}
export { x as after };

5
test/function/functions-renamed-correctly/before.js

@ -0,0 +1,5 @@
function x () {
console.log( 'before' );
}
export { x as before };

7
test/function/functions-renamed-correctly/factorial.js

@ -0,0 +1,7 @@
var x = (function () {
return function x ( num ) {
return num <= 2 ? num : num * x( num - 1 );
};
})();
export { x };

7
test/function/functions-renamed-correctly/main.js

@ -0,0 +1,7 @@
import { before } from './before';
import { x } from './factorial';
import { after } from './after';
before();
assert.equal( x( 5 ), 120 );
after();

9
test/function/shadowed-exported-var/_config.js

@ -1,9 +0,0 @@
var assert = require( 'assert' );
module.exports = {
description: 'handles shadowed exported variable',
exports: function ( exports ) {
assert.equal( exports.foo(), 42 );
},
// solo: true
};

9
test/function/shadowed-exported-var/main.js

@ -1,9 +0,0 @@
var foo;
foo = (function () {
return function foo () {
return 42;
};
})();
export { foo };
Loading…
Cancel
Save