<commit_before>import { augment, TestComponent, TestComponentFunction } from "./utils";
import { $t, $h, $s, $c, $i, $m } from "../src/vdom/vnode_builder";

const expect = chai.expect;

describe("augment", () => {
    it("'abc'", () => {
        augment($t("abc"), "abc");
    });

    it("<div>", () => {
        augment($h("div"), "<div></div>");
    });

    it("<span>", () => {
        augment($h("span"), "<span></span>");
    });

    it("<div> (null props)", () => {
        augment($h("div").props(null), "<div></div>");
    });

    it("<div> ({} props)", () => {
        augment($h("div").props({}), "<div></div>");
    });

    it("<div tabIndex='1'>", () => {
        augment($h("div").props({ tabIndex: 1 }), `<div tabIndex="1"></div>`);
    });

    it("<div tabIndex='1' title='2'>", () => {
        augment($h("div").props({ tabIndex: 1, title: "2" }), `<div tabIndex="1" title="2"></div>`);
    });

    it("<div data-abc='a'", () => {
        augment($h("div").props({ "data-abc": "a" }), `<div data-abc="a"></div>`);
    });

    it("<div aria-type='button'", () => {
        augment($h("div").props({ "aria-type": "button" }), `<div aria-type="button"></div>`);
    });

    it("<div class=null>", () => {
        augment($h("div").className(null), `<div></div>`);
    });

    it("<div class=''>", () => {
        augment($h("div", ""), `<div class=""></div>`);
    });

    it("<div class='a'>", () => {
        augment($h("div", "a"), `<div class="a"></div>`);
    });

    it("<div class='a b'>", () => {
        augment($h("div", "a b"), `<div class="a b"></div>`);
    });

    it("<div style=null>", () => {
        augment($h("div").style(null), `<div></div>`);
    });

    it("<div style=''>", () => {
        augment($h("div").style(""), `<div style=""></div>`);
    });

    it("<div style={}>", () => {
        augment($h("div").style(""), `<div></div>`);
    });

    it("<div style='top: 10px'>", () => {
        augment($h("div").style("top: 10px"), `<div style="top: 10px"></div>`);
    });

    it("<div style={top: 10px}>", () => {
        augment($h("div").style({ top: "10px" }), `<div style="top:10px"></div>`);
    });

    it("<div style={top: 10px; left: 20px}>", () => {
        augment($h("div").style({ top: "10px", left: "20px" }), `<div style="top:10px;left:20px"></div>`);
    });

    it("<div></div> (null children)", () => {
        augment($h("div").children(null), `<div></div>`);
    });

    it("<div>'abc'</div>", () => {
        augment($h("div").children("abc"), `<div>abc</div>`);
    });

    it("<div>10</div>", () => {
        augment($h("div").children(10), `<div>10</div>`);
    });

    it("<div>true</div>", () => {
        augment($h("div").children(true), `<div>true</div>`);
    });

    it("<div><span></div>", () => {
        augment($h("div").children($h("span")), `<div><span></span></div>`);
    });

    it("<div>[]</div>", () => {
        augment($h("div").children([]), `<div></div>`);
    });

    it("<div>[<span>]</div>", () => {
        augment($h("div").children([$h("span")]), `<div><span></span></div>`);
    });

    it("<div>[<span>, <strong>]</div>", () => {
        augment($h("div").children([$h("span"), $h("strong")]), `<div><span></span><strong></strong></div>`);
    });

    it("<div>[" +
        "  <div>'hello'</div>," +
        "  <div>[<span>'world'</span>, <div><span></div>]</div>," +
        "  <div><div></div>," +
        "  <div>" +
        "]</div>", () => {
            augment($h("div").children([
                $h("div").children("hello"),
                $h("div").children([$h("span").children("world"), $h("div").children($h("span"))]),
                $h("div").children($h("div")),
                $h("div"),
            ]), `<div><div>hello</div><div><span>world</span><div><span></span></div></div><div><div></div></div>` +
                `<div></div></div>`);
        });

    describe("svg", () => {
        it("<circle>", () => {
            augment($s("circle"), `<circle></circle>`);
        });

        it("<circle class='a'>", () => {
            augment($s("circle", "a"), `<circle class="a"></circle>`);
        });

        it("<circle style='top: 10px'>", () => {
            augment($s("circle").style("top: 10px"), `<circle style="top: 10px"></circle>`);
        });

        it("<circle style={top: 10px}>", () => {
            augment($s("circle").style({ top: "10px" }), `<circle style="top:10px"></circle>`);
        });

        it("<circle xlink:href='a'>", () => {
            augment($s("circle").props({ "xlink:href": "a" }), `<circle xlink:href="a"></circle>`);
        });

        it("<circle xml:text='a'>", () => {
            augment($s("circle").props({ "xml:test": "a" }), `<circle xml:text="a"></circle>`);
        });
    });

    describe("children normalization", () => {
        it("<div>[<span>, [<strong>, <a>], <span>]</div>", () => {
            augment($h("div").children([$h("span"), [$h("strong"), $h("a")], $h("span")]),
                `<div><span></span><strong></strong><a></a><span></span></div>`);
        });

        it("<div>['abc', []]</div>", () => {
            augment($h("div").children(["abc", []]), `<div>abc</div>`);
        });

        it("<div>[[[<div>, <span>]]]</div>", () => {
            augment($h("div").children([[[$h("div"), $h("span")]]]), `<div><div></div><span></span></div>`);
        });

        it("<div>[<div>, null, <span>]</div>", () => {
            augment($h("div").children([$h("div"), null, $h("span")]), `<div><div></div><span></span></div>`);<commit_msg>Remove old tests for string styles<commit_after>import { augment, TestComponent, TestComponentFunction } from "./utils";
import { $t, $h, $s, $c, $i, $m } from "../src/vdom/vnode_builder";

const expect = chai.expect;

describe("augment", () => {
    it("'abc'", () => {
        augment($t("abc"), "abc");
    });

    it("<div>", () => {
        augment($h("div"), "<div></div>");
    });

    it("<span>", () => {
        augment($h("span"), "<span></span>");
    });

    it("<div> (null props)", () => {
        augment($h("div").props(null), "<div></div>");
    });

    it("<div> ({} props)", () => {
        augment($h("div").props({}), "<div></div>");
    });

    it("<div tabIndex='1'>", () => {
        augment($h("div").props({ tabIndex: 1 }), `<div tabIndex="1"></div>`);
    });

    it("<div tabIndex='1' title='2'>", () => {
        augment($h("div").props({ tabIndex: 1, title: "2" }), `<div tabIndex="1" title="2"></div>`);
    });

    it("<div data-abc='a'", () => {
        augment($h("div").props({ "data-abc": "a" }), `<div data-abc="a"></div>`);
    });

    it("<div aria-type='button'", () => {
        augment($h("div").props({ "aria-type": "button" }), `<div aria-type="button"></div>`);
    });

    it("<div class=null>", () => {
        augment($h("div").className(null), `<div></div>`);
    });

    it("<div class=''>", () => {
        augment($h("div", ""), `<div class=""></div>`);
    });

    it("<div class='a'>", () => {
        augment($h("div", "a"), `<div class="a"></div>`);
    });

    it("<div class='a b'>", () => {
        augment($h("div", "a b"), `<div class="a b"></div>`);
    });

    it("<div style=null>", () => {
        augment($h("div").style(null), `<div></div>`);
    });

    it("<div style={}>", () => {
        augment($h("div").style(""), `<div></div>`);
    });

    it("<div style={top: 10px}>", () => {
        augment($h("div").style({ top: "10px" }), `<div style="top:10px"></div>`);
    });

    it("<div style={top: 10px; left: 20px}>", () => {
        augment($h("div").style({ top: "10px", left: "20px" }), `<div style="top:10px;left:20px"></div>`);
    });

    it("<div></div> (null children)", () => {
        augment($h("div").children(null), `<div></div>`);
    });

    it("<div>'abc'</div>", () => {
        augment($h("div").children("abc"), `<div>abc</div>`);
    });

    it("<div>10</div>", () => {
        augment($h("div").children(10), `<div>10</div>`);
    });

    it("<div>true</div>", () => {
        augment($h("div").children(true), `<div>true</div>`);
    });

    it("<div><span></div>", () => {
        augment($h("div").children($h("span")), `<div><span></span></div>`);
    });

    it("<div>[]</div>", () => {
        augment($h("div").children([]), `<div></div>`);
    });

    it("<div>[<span>]</div>", () => {
        augment($h("div").children([$h("span")]), `<div><span></span></div>`);
    });

    it("<div>[<span>, <strong>]</div>", () => {
        augment($h("div").children([$h("span"), $h("strong")]), `<div><span></span><strong></strong></div>`);
    });

    it("<div>[" +
        "  <div>'hello'</div>," +
        "  <div>[<span>'world'</span>, <div><span></div>]</div>," +
        "  <div><div></div>," +
        "  <div>" +
        "]</div>", () => {
            augment($h("div").children([
                $h("div").children("hello"),
                $h("div").children([$h("span").children("world"), $h("div").children($h("span"))]),
                $h("div").children($h("div")),
                $h("div"),
            ]), `<div><div>hello</div><div><span>world</span><div><span></span></div></div><div><div></div></div>` +
                `<div></div></div>`);
        });

    describe("svg", () => {
        it("<circle>", () => {
            augment($s("circle"), `<circle></circle>`);
        });

        it("<circle class='a'>", () => {
            augment($s("circle", "a"), `<circle class="a"></circle>`);
        });

        it("<circle style={top: 10px}>", () => {
            augment($s("circle").style({ top: "10px" }), `<circle style="top:10px"></circle>`);
        });

        it("<circle xlink:href='a'>", () => {
            augment($s("circle").props({ "xlink:href": "a" }), `<circle xlink:href="a"></circle>`);
        });

        it("<circle xml:text='a'>", () => {
            augment($s("circle").props({ "xml:test": "a" }), `<circle xml:text="a"></circle>`);
        });
    });

    describe("children normalization", () => {
        it("<div>[<span>, [<strong>, <a>], <span>]</div>", () => {
            augment($h("div").children([$h("span"), [$h("strong"), $h("a")], $h("span")]),
                `<div><span></span><strong></strong><a></a><span></span></div>`);
        });

        it("<div>['abc', []]</div>", () => {
            augment($h("div").children(["abc", []]), `<div>abc</div>`);
        });

        it("<div>[[[<div>, <span>]]]</div>", () => {
            augment($h("div").children([[[$h("div"), $h("span")]]]), `<div><div></div><span></span></div>`);
        });

        it("<div>[<div>, null, <span>]</div>", () => {
            augment($h("div").children([$h("div"), null, $h("span")]), `<div><div></div><span></span></div>`);
{'fraction_non_alphanumeric': 0.34640765870434054, 'fraction_numerical': 0.008365089692350591, 'mean_word_length': 2.7387074357192494, 'pattern_counts': {'":': 8, '<': 372, '<?xml version=': 0, '>': 447, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '1963957', 'n_tokens_mistral': 3812, 'n_tokens_neox': 3749, 'n_words': 471}