<commit_before>module sax.xaml.extensions.tests.basic {
    QUnit.module('Markup Extension');

    QUnit.test("Empty Extension", () => {
        helpers.parse("{Empty }", cmds => {
            var i = 0;
            deepEqual(cmds[i], {
                cmd: 'rt',
                xmlns: sax.xaml.DEFAULT_XMLNS,
                name: 'Empty',
                type: cmds[i].type
            }, 'rt Empty');
            i++;
            var em = cmds[i].obj;
            deepEqual(cmds[i], {
                cmd: 'or',
                type: cmds[i - 1].type,
                obj: em
            }, 'or Empty');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: em
            }, 'os Empty');
            strictEqual(cmds.length, i + 1);
        });
    });

    QUnit.test("StaticResource", () => {
        helpers.parse("{StaticResource SomeStyle}", cmds => {
            var i = 0;
            deepEqual(cmds[i], {
                cmd: 'rt',
                xmlns: sax.xaml.DEFAULT_XMLNS,
                name: 'StaticResource',
                type: cmds[i].type
            }, 'rt StaticResource');
            i++;
            var sr = cmds[i].obj;
            deepEqual(cmds[i], {
                cmd: 'or',
                type: cmds[i - 1].type,
                obj: sr
            }, 'or StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: sr
            }, 'os StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'ps',
                propName: null
            }, 'ps [Implicit]');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: "SomeStyle"
            }, 'os \'SomeStyle\'');
            i++;
            deepEqual(cmds[i], {
                cmd: 'pe',
                propName: null
            }, 'pe [Implicit]');
            strictEqual(cmds.length, i + 1);
        });
    });

    QUnit.test("StaticResource with Property", () => {
        helpers.parse("{StaticResource ResourceKey=SomeStyle}", cmds => {
            var i = 0;
            deepEqual(cmds[i], {
                cmd: 'rt',
                xmlns: sax.xaml.DEFAULT_XMLNS,
                name: 'StaticResource',
                type: cmds[i].type
            }, 'rt StaticResource');
            i++;
            var sr = cmds[i].obj;
            deepEqual(cmds[i], {
                cmd: 'or',
                type: cmds[i - 1].type,
                obj: sr
            }, 'or StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: sr
            }, 'os StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'ps',
                propName: "ResourceKey"
            }, 'ps ResourceKey');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: "SomeStyle"
            }, 'os \'SomeStyle\'');
            i++;
            deepEqual(cmds[i], {
                cmd: 'pe',
                propName: "ResourceKey"
            }, 'ps ResourceKey');
            strictEqual(cmds.length, i + 1);
        });
    });
}<commit_msg>Expanding basic extension parser test to include escaped character.<commit_after>module sax.xaml.extensions.tests.basic {
    QUnit.module('Markup Extension');

    QUnit.test("Empty Extension", () => {
        helpers.parse("{Empty }", cmds => {
            var i = 0;
            deepEqual(cmds[i], {
                cmd: 'rt',
                xmlns: sax.xaml.DEFAULT_XMLNS,
                name: 'Empty',
                type: cmds[i].type
            }, 'rt Empty');
            i++;
            var em = cmds[i].obj;
            deepEqual(cmds[i], {
                cmd: 'or',
                type: cmds[i - 1].type,
                obj: em
            }, 'or Empty');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: em
            }, 'os Empty');
            strictEqual(cmds.length, i + 1);
        });
    });

    QUnit.test("StaticResource", () => {
        helpers.parse("{StaticResource SomeStyle}", cmds => {
            var i = 0;
            deepEqual(cmds[i], {
                cmd: 'rt',
                xmlns: sax.xaml.DEFAULT_XMLNS,
                name: 'StaticResource',
                type: cmds[i].type
            }, 'rt StaticResource');
            i++;
            var sr = cmds[i].obj;
            deepEqual(cmds[i], {
                cmd: 'or',
                type: cmds[i - 1].type,
                obj: sr
            }, 'or StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: sr
            }, 'os StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'ps',
                propName: null
            }, 'ps [Implicit]');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: "SomeStyle"
            }, 'os \'SomeStyle\'');
            i++;
            deepEqual(cmds[i], {
                cmd: 'pe',
                propName: null
            }, 'pe [Implicit]');
            strictEqual(cmds.length, i + 1);
        });
    });

    QUnit.test("StaticResource with Property", () => {
        helpers.parse("{StaticResource ResourceKey=Some\\{Style}", cmds => {
            var i = 0;
            deepEqual(cmds[i], {
                cmd: 'rt',
                xmlns: sax.xaml.DEFAULT_XMLNS,
                name: 'StaticResource',
                type: cmds[i].type
            }, 'rt StaticResource');
            i++;
            var sr = cmds[i].obj;
            deepEqual(cmds[i], {
                cmd: 'or',
                type: cmds[i - 1].type,
                obj: sr
            }, 'or StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: sr
            }, 'os StaticResource');
            i++;
            deepEqual(cmds[i], {
                cmd: 'ps',
                propName: "ResourceKey"
            }, 'ps ResourceKey');
            i++;
            deepEqual(cmds[i], {
                cmd: 'os',
                obj: "Some{Style"
            }, 'os \'Some{Style\'');
            i++;
            deepEqual(cmds[i], {
                cmd: 'pe',
                propName: "ResourceKey"
            }, 'ps ResourceKey');
            strictEqual(cmds.length, i + 1);
        });
    });
}
{'fraction_non_alphanumeric': 0.14777420835245525, 'fraction_numerical': 0.0027535566773749425, 'mean_word_length': 1.036760124610592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '3197907', 'n_tokens_mistral': 1957, 'n_tokens_neox': 1810, 'n_words': 374}