Browse Source

failing test for #36

contingency-plan
Rich Harris 9 years ago
parent
commit
7eeaf73eb1
  1. 11
      test/function/cycles-pathological/A.js
  2. 8
      test/function/cycles-pathological/B.js
  3. 8
      test/function/cycles-pathological/C.js
  4. 11
      test/function/cycles-pathological/D.js
  5. 19
      test/function/cycles-pathological/_config.js
  6. 12
      test/function/cycles-pathological/main.js

11
test/function/cycles-pathological/A.js

@ -0,0 +1,11 @@
import B from './B';
export default class A {
constructor () {
this.isA = true;
}
b () {
return new B();
}
}

8
test/function/cycles-pathological/B.js

@ -0,0 +1,8 @@
import A from './A';
export default class B extends A {
constructor () {
super();
this.isB = true;
}
}

8
test/function/cycles-pathological/C.js

@ -0,0 +1,8 @@
import D from './D';
export default class C extends D {
constructor () {
super();
this.isC = true;
}
}

11
test/function/cycles-pathological/D.js

@ -0,0 +1,11 @@
import C from './C';
export default class D {
constructor () {
this.isD = true;
}
c () {
return new C();
}
}

19
test/function/cycles-pathological/_config.js

@ -0,0 +1,19 @@
var assert = require( 'assert' );
module.exports = {
description: 'resolves pathological cyclical dependencies gracefully',
babel: true,
exports: function ( exports ) {
assert.ok( exports.a.isA );
assert.ok( exports.b1.isA );
assert.ok( exports.b1.isB );
assert.ok( exports.b2.isA );
assert.ok( exports.b2.isB );
assert.ok( exports.c1.isC );
assert.ok( exports.c1.isD );
assert.ok( exports.c2.isC );
assert.ok( exports.c2.isD );
assert.ok( exports.d.isD );
},
solo: true
};

12
test/function/cycles-pathological/main.js

@ -0,0 +1,12 @@
import A from './A';
import B from './B';
import C from './C';
import D from './D';
export const a = new A();
export const b1 = a.b();
export const b2 = new B();
export const c1 = new C();
export const d = new D();
export const c2 = d.c();
Loading…
Cancel
Save