"use strict";

var fs = require("fs");
var range = require("lodash/utility/range");

var RefnumEncode = require("../lib/RefnumEncode");

function generateRegressionTestData() {
    return ["J", "P", "J15"].reduce((data, prefix) => {
        range(1, 1000).forEach(id => {
            var string = prefix + "|" + id;
            var refnum = RefnumEncode.encode(string);
            data.push({string, refnum});
        });
        return data;
    }, []);
}

if (require.main === module) {
    fs.writeFileSync(
        __dirname + "/regression_data.json",
        JSON.stringify(generateRegressionTestData(), null, "  "),
    );
}
