<commit_before>import {VirtualEditor} from "./VirtualEditor";
import {Position, VimStyle} from "../src/VimStyle";
import {VimTests} from "./vim/VimTests";
let assert = require("assert");
let exec = require("child_process").exec;
let fs = require("fs");

for (let target in VimTests) {
    describe("OriginalVim " + target, function() {
        this.timeout(500);
        let test = VimTests[target];
        for (let specName in test) {
            (function(specName) {
                it(specName, function(done) {
                    let spec = test[specName];
                    let text = spec["in"][0];
                    for (let i = 1; i < spec["in"].length; i++) {
                        text += "\n" + spec["in"][i];
                    }
                    fs.writeFile("OriginalVimInput", text);
                    text = "/|\n";
                    text += ":normal x\n";
                    let list = spec["key"].split("_");
                    for (let i = 0; i < list.length; i++) {
                        text += ":normal " + list[i] + "\n";
                    }
                    text += ":normal i|\n";
                    text += ":w! OriginalVimOutput\n";
                    text += ":q!\n";
                    fs.writeFile("OriginalVimKey", text);
                    let child = exec("vim -u NONE -s OriginalVimKey OriginalVimInput");
                    child.on("exit", function() {
                        let i = 0;
                        fs.readFile("OriginalVimOutput", function(err, text) {
                            let out = text.toString().split("\n");
                            assert.equal(out.length - 1, spec["out"].length);
                            let outText = out[0];
                            let specText = spec.out[0]
                            for (let i = 1; i < spec["out"].length; i++) {
                                outText += "\n" + out[i];
                                specText += "\n" + spec.out[i];
                            }
                            assert.equal(outText, specText);
                            done();
                        });
                    });
                });
            })(specName);
        }
    });
} <commit_msg>update test<commit_after>import {VirtualEditor} from "./VirtualEditor";
import {Position, VimStyle} from "../src/VimStyle";
import {VimTests} from "./vim/VimTests";
let assert = require("assert");
let exec = require("child_process").exec;
let fs = require("fs");

for (let target in VimTests) {
    describe("OriginalVim " + target, function() {
        this.timeout(500);
        let test = VimTests[target];
        for (let specName in test) {
            (function(specName) {
                it(specName, function(done) {
                    let spec = test[specName];
                    let text = spec["in"][0];
                    for (let i = 1; i < spec["in"].length; i++) {
                        text += "\n" + spec["in"][i];
                    }
                    fs.writeFile("OriginalVimInput", text);
                    text = "/|\n";
                    text += ":normal x\n";
                    let list = spec["key"].split("_");
                    for (let i = 0; i < list.length; i++) {
                        text += ":normal " + list[i] + "\n";
                    }
                    text += ":normal i|\n";
                    text += ":w! OriginalVimOutput\n";
                    text += ":q!\n";
                    fs.writeFile("OriginalVimKey", text);
                    let child = exec("vim -u NONE -s OriginalVimKey OriginalVimInput");
                    child.on("exit", function() {
                        let i = 0;
                        fs.readFile("OriginalVimOutput", function(err, text) {
                            let out = text.toString().split("\n");
                            let outText = out[0];
                            let specText = spec.out[0]
                            for (let i = 1; i < spec["out"].length; i++) {
                                outText += "\n" + out[i];
                                specText += "\n" + spec.out[i];
                            }
                            assert.equal(outText, specText);
                            done();
                        });
                    });
                });
            })(specName);
        }
    });
} 
{'fraction_non_alphanumeric': 0.14467697907188354, 'fraction_numerical': 0.004777070063694267, 'mean_word_length': 1.077977315689981, 'pattern_counts': {'":': 10, '<': 9, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4200710', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1097, 'n_words': 266}