#!/usr/bin/env node

require('./proof')(3, function (step, tmp, serialize, deepEqual, load, objectify, say, Strata, gather) {
    var fs = require('fs'), strata, records = []

    step(function () {
        serialize(__dirname + '/fixtures/split.before.json', tmp, step())
    }, function () {
        strata = new Strata({ directory: tmp, leafSize: 3, branchSize: 3 })
        strata.open(step())
    }, function () {
        strata.mutator('b', step())
    }, function (cursor) {
        step(function () {
            cursor.insert('b', 'b', ~ cursor.index, step())
        }, function () {
            cursor.unlock()
            gather(step, strata)
        })
    }, function (records) {
        deepEqual(records, [ 'a', 'b', 'c', 'd' ], 'records')
    }, function () {
        strata.balance(step())
    }, function () {

        objectify(tmp, step())
        load(__dirname + '/fixtures/split.after.json', step())

    }, function(actual, expected) {

        say(actual)
        say(expected)

        deepEqual(actual, expected, 'split')

        strata.purge(0)
        deepEqual(strata.size, 0, 'purged')

        strata.close(step())
    })
})

@@ -56,124 +56,89 @@
 ep, 
-tmp, serialize, deepEqual, load, objectify, say, Strata, gather) %7B%0A    var fs = require('fs'), strata, records = %5B%5D%0A
+Strata, tmp, load, serialize, objectify, gather, deepEqual, say) %7B%0A    var strata
 %0A   
@@ -783,25 +783,24 @@
 nction () %7B%0A
-%0A
         obje
@@ -881,17 +881,16 @@
 step())%0A
-%0A
     %7D, f
@@ -917,17 +917,16 @@
 cted) %7B%0A
-%0A
         

Use `assert` in `t/basics/split.t.js`.