<commit_before>
{ Template } = require '../async-xml'

module.exports =

    simple: (æ) ->
        xml = new Template ->
            @$tag('test')
        xml.on 'end', æ.done
        xml.on 'data', (tag) -> æ.equal "<test/>", tag


    html5: (æ) ->
        content = ["a", "b", "c"]
        xml = new Template schema:'html5', ->
            @$html ->
                @$body ->
                    @$div class:'test', "lala"
                    @ul ->
                        content.forEach (data) =>
                            @$li(null, data)
                        @end()

        xml.on 'end', æ.done
        xml.on 'data', (tag) -> æ.equal results.shift(), tag
        results = [
            '<html>'
            '<body>'
            '<div class="test">'
            'lala'
            '</div>'
            '<ul>'
            '<li>'
            'a'
            '</li>'
            '<li>'<commit_msg>ok. this works too<commit_after>
{ Template } = require '../async-xml'

module.exports =

    simple: (æ) ->
        xml = new Template ->
            @$tag('test')
        xml.on 'end', æ.done
        xml.on 'data', (tag) -> æ.equal "<test/>", tag


    html5: (æ) ->
        content = ["a", "b", "c"]
        xml = new Template schema:'html5', ->
            @$html ->
                @$body ->
                    @$div class:'test', "lala"
                    @$ul ->
                        content.forEach (data) =>
                            @$li(null, data)

        xml.on 'end', æ.done
        xml.on 'data', (tag) -> æ.equal results.shift(), tag
        results = [
            '<html>'
            '<body>'
            '<div class="test">'
            'lala'
            '</div>'
            '<ul>'
            '<li>'
            'a'
            '</li>'
            '<li>'
{'fraction_non_alphanumeric': 0.18217270194986074, 'fraction_numerical': 0.0022284122562674096, 'mean_word_length': 0.9955555555555555, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '4087600', 'n_tokens_mistral': 544, 'n_tokens_neox': 534, 'n_words': 125}