
var test = require('tape')
var Value = require('../')

test('set, get', function (t) {
  var v = new Value()
  v.set('hello')

  t.equal('hello', v.get())
  t.end()
})

test('history', function (t) {
  var v = new Value()
  v.histLength = 10
  v.set('hello')
  v.set(Math.random())
  v.set({thing: true})

  t.deepEqual({thing: true}, v.get())
  console.log(v.history())
  t.end()
})


@@ -211,24 +211,41 @@
  new Value()
+, updates = %5B%5D, r
 %0A  v.histLen
@@ -253,16 +253,63 @@
 th = 10%0A
+%0A  v.on('update', updates.push.bind(updates))%0A%0A
   v.set(
@@ -325,16 +325,20 @@
   v.set(
+r = 
 Math.ran
@@ -406,16 +406,85 @@
 .get())%0A
+  t.deepEqual(updates, %5B%0A    'hello',%0A    r,%0A    %7Bthing: true%7D%0A  %5D)%0A%0A
   consol

test update event