'use strict'

const WFSM = require('../src/index.js');
var assert = require('assert');

it('removeEpsilon', function() {

	var wfsm = new WFSM();
	wfsm.setE( 0, 1, 0, 0, 0.25 );
	wfsm.setE( 0, 1, wfsm.EPS, wfsm.EPS, 0.5 );
	wfsm.setE( 1, 1, wfsm.EPS, wfsm.EPS, 0.2 );
	wfsm.setE( 1, 0, 1, 1, 0.5 );

	wfsm.setI( 1, 1 );
	wfsm.setF( 1, 0.3 );
	wfsm.setF( 0, 0.25 );

	wfsm.removeEpsilon();
	assert.equal(JSON.stringify(wfsm.Q), '[[{"0":{"1":{"1":0.3125}},"1":{"0":{"0":0.25},"-1":{}}},0.4375,0],[{"0":{"1":{"1":0.625}},"1":{"-1":{}}},0.375,1]]');
});

@@ -543,8 +543,436 @@
 ');%0A%7D);%0A
+%0A%0Ait('union', function() %7B%0A%0A%09var fsm1 = new WFSM();%0A%09fsm1.setE( 0, 1, 0 );%0A%09fsm1.setE( 0, 2, 1 );%0A%09fsm1.setI( 0, 0.4 );%0A%09fsm1.setF( 1 );%0A%09fsm1.setF( 2 );%0A%0A%09var fsm2 = new WFSM();%0A%09fsm2.setE( 0, 1, 2 );%0A%09fsm2.setI( 0, 0.6 );%0A%09fsm2.setF( 1 );%0A%0A%09fsm1.union( fsm2 );%0A%0A%09assert.equal(JSON.stringify(fsm1.Q), '%5B%5B%7B%221%22:%7B%220%22:%7B%220%22:1%7D%7D,%222%22:%7B%221%22:%7B%221%22:1%7D%7D%7D,0,0%5D,%5B%7B%7D,1,0%5D,%5B%7B%7D,1,0%5D,%5B%7B%220%22:%7B%22-1%22:%7B%22-1%22:0.4%7D%7D,%224%22:%7B%22-1%22:%7B%22-1%22:0.6%7D%7D%7D,0,1%5D%5D'); %0A%0A%7D);%0A

Add union.