<commit_before>#!/usr/bin/env node

Error.stackTraceLimit = Infinity

require('./proof')(3, function (step, Strata, tmp, load, serialize, objectify, gather, assert) {
    var strata = new Strata({ directory: tmp, leafSize: 3, branchSize: 3 })
    step(function () {
        serialize(__dirname + '/fixtures/branch.before.json', tmp, step())
    }, function () {
        strata.open(step())
    }, function () {
        strata.mutator('h', step())
    }, function (cursor) {
        step(function () {
            cursor.indexOf('h', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.indexOf('i', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.unlock()
        })
    }, function () {
        strata.mutator('e', step())
    }, function (cursor) {
        step(function () {
            cursor.indexOf('e', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.indexOf('g', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.unlock()
        })
    }, function () {
        strata.mutator('m', step())
    }, function (cursor) {
        step(function () {
            cursor.indexOf('m', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.indexOf('n', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.unlock()
        })
    }, function () {
        gather(step, strata)
    }, function (records) {
        assert(records, [ 'a', 'b', 'c', 'd',  'f', 'j', 'k', 'l' ], 'records')
        strata.balance(step())
    }, function () {
        strata.balance(step())
    }, function () {
        objectify(tmp, step())
        load(__dirname + '/fixtures/root-fill.after.json', step())
    }, function (actual, expected) {
        assert(actual, expected, 'merge')
    }, function () {
        gather(step, strata)
    }, function (records) {
        assert(records, [ 'a', 'b', 'c', 'd', 'f', 'j', 'k', 'l' ], 'merged')
    }, function() {
        strata.close(step())
    })
})<commit_msg>Use `vivify` in `t/merge/root-fill.t.js`.<commit_after>#!/usr/bin/env node

Error.stackTraceLimit = Infinity

require('./proof')(3, function (step, Strata, tmp, load, serialize, vivify, gather, assert) {
    var strata = new Strata({ directory: tmp, leafSize: 3, branchSize: 3 })
    step(function () {
        serialize(__dirname + '/fixtures/branch.before.json', tmp, step())
    }, function () {
        strata.open(step())
    }, function () {
        strata.mutator('h', step())
    }, function (cursor) {
        step(function () {
            cursor.indexOf('h', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.indexOf('i', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.unlock()
        })
    }, function () {
        strata.mutator('e', step())
    }, function (cursor) {
        step(function () {
            cursor.indexOf('e', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.indexOf('g', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.unlock()
        })
    }, function () {
        strata.mutator('m', step())
    }, function (cursor) {
        step(function () {
            cursor.indexOf('m', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.indexOf('n', step())
        }, function (index) {
            cursor.remove(index, step())
        }, function () {
            cursor.unlock()
        })
    }, function () {
        gather(step, strata)
    }, function (records) {
        assert(records, [ 'a', 'b', 'c', 'd',  'f', 'j', 'k', 'l' ], 'records')
        strata.balance(step())
    }, function () {
        strata.balance(step())
    }, function () {
        vivify(tmp, step())
        load(__dirname + '/fixtures/root-fill.after.json', step())
    }, function (actual, expected) {
        assert(actual, expected, 'merge')
    }, function () {
        gather(step, strata)
    }, function (records) {
        assert(records, [ 'a', 'b', 'c', 'd', 'f', 'j', 'k', 'l' ], 'merged')
    }, function() {
        strata.close(step())
    })
})
{'fraction_non_alphanumeric': 0.1916809605488851, 'fraction_numerical': 0.001286449399656947, 'mean_word_length': 1.9450757575757576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2228622', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1356, 'n_words': 285}