var coinSelect = require('../')
var fixtures = require('./fixtures')
var tape = require('tape')

fixtures.forEach(function (f) {
  tape(f.description, function (t) {
    var outputs = f.outputs.map(value => ({ value }))
    var unspents = f.unspents.map((value, i) => ({ i, value }))
    var result = coinSelect(unspents, outputs, f.feeRate)

    // drop non-index related input data for easy result comparison
    if (result.inputs) {
      result.inputs = result.inputs.map(input => input.i)
    }

    t.deepEqual(result, f.expected)
    t.end()
  })
})

@@ -195,18 +195,34 @@
 map(
-value =%3E (
+function (value) %7B return 
 %7B va
@@ -218,33 +218,34 @@
 return %7B value %7D
-)
+ %7D
 )%0A    var unspen
@@ -264,16 +264,25 @@
 nts.map(
+function 
 (value, 
@@ -288,12 +288,17 @@
  i) 
-=%3E (
+%7B return 
 %7B i,
@@ -305,17 +305,18 @@
  value %7D
-)
+ %7D
 )%0A    va
@@ -505,24 +505,41 @@
 map(
-input =%3E
+function (input) %7B return
  input.i
 )%0A  
@@ -534,16 +534,18 @@
  input.i
+ %7D
 )%0A    %7D%0A

use ES5 for tests too