diff --git a/test/function/export-from-with-definition-conflict/_config.js b/test/function/export-from-with-definition-conflict/_config.js new file mode 100644 index 0000000..b9bc78a --- /dev/null +++ b/test/function/export-from-with-definition-conflict/_config.js @@ -0,0 +1,12 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'ignores conflict between local definitions and export from declaration', + exports: function ( exports ) { + assert.equal( exports.foo, 'a-bar' ); + assert.equal( exports.bar, 'a-foo' ); + assert.equal( exports.baz, 'a-baz' ); + } +}; + +// https://github.com/rollup/rollup/issues/16 diff --git a/test/function/export-from-with-definition-conflict/a.js b/test/function/export-from-with-definition-conflict/a.js new file mode 100644 index 0000000..c24adbf --- /dev/null +++ b/test/function/export-from-with-definition-conflict/a.js @@ -0,0 +1,3 @@ +export var foo = 'a-foo'; +export var bar = 'a-bar'; +export var baz = 'a-baz'; diff --git a/test/function/export-from-with-definition-conflict/main.js b/test/function/export-from-with-definition-conflict/main.js new file mode 100644 index 0000000..91eed71 --- /dev/null +++ b/test/function/export-from-with-definition-conflict/main.js @@ -0,0 +1,9 @@ +var foo = 'local-foo'; +var baz = 'local-baz'; + +export { foo as bar } from './a'; +export { bar as foo } from './a'; +export { baz } from './a'; + +assert.equal( foo, 'b-foo' ); +assert.equal( baz, 'b-baz' ); diff --git a/test/function/export-from-with-import-conflict/_config.js b/test/function/export-from-with-import-conflict/_config.js new file mode 100644 index 0000000..2b61c4a --- /dev/null +++ b/test/function/export-from-with-import-conflict/_config.js @@ -0,0 +1,12 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'ignores conflict between import declaration and export from declaration', + exports: function ( exports ) { + assert.equal( exports.foo, 'a-bar' ); + assert.equal( exports.bar, 'a-foo' ); + assert.equal( exports.baz, 'a-baz' ); + } +}; + +// https://github.com/rollup/rollup/issues/16 diff --git a/test/function/export-from-with-import-conflict/a.js b/test/function/export-from-with-import-conflict/a.js new file mode 100644 index 0000000..c24adbf --- /dev/null +++ b/test/function/export-from-with-import-conflict/a.js @@ -0,0 +1,3 @@ +export var foo = 'a-foo'; +export var bar = 'a-bar'; +export var baz = 'a-baz'; diff --git a/test/function/export-from-with-import-conflict/b.js b/test/function/export-from-with-import-conflict/b.js new file mode 100644 index 0000000..a1c82e5 --- /dev/null +++ b/test/function/export-from-with-import-conflict/b.js @@ -0,0 +1,2 @@ +export var foo = 'b-foo'; +export var baz = 'b-baz'; diff --git a/test/function/export-from-with-import-conflict/main.js b/test/function/export-from-with-import-conflict/main.js new file mode 100644 index 0000000..edc705e --- /dev/null +++ b/test/function/export-from-with-import-conflict/main.js @@ -0,0 +1,8 @@ +import { foo, baz } from './b'; + +export { foo as bar } from './a'; +export { bar as foo } from './a'; +export { baz } from './a'; + +assert.equal( foo, 'b-foo' ); +assert.equal( baz, 'b-baz' );