<commit_before>assert = require 'power-assert'
bHtml = require './'

describe 'index', ->
  context 'comment', ->
    context 'simple', ->
      it 'works', ->
        source = '''
          <!-- hoge
        '''
        context = {}
        expected = []
        template = bHtml source
        assert.deepEqual template(context), expected

    context 'complex', ->
      it 'works', ->
        source = '''
          <p
            <!-- hoge
        '''
        context = {}
        expected = [
          tag: 'p'
          attrs: {}
          children: []
        ]
        template = bHtml source
        assert.deepEqual template(context), expected

  context 'doctype', ->
    context 'simple', ->
      it 'works', ->
        source = '''
          <!doctype html
        '''
        context = {}
        expected = []
        template = bHtml source
        assert.deepEqual template(context), expected

    context 'complex', ->
      it 'works', ->
        # no tests<commit_msg>add tests for element<commit_after>assert = require 'power-assert'
bHtml = require './'

describe 'index', ->
  context 'comment', ->
    context 'simple', ->
      it 'works', ->
        source = '''
          <!-- hoge
        '''
        context = {}
        expected = []
        template = bHtml source
        assert.deepEqual template(context), expected

    context 'complex', ->
      it 'works', ->
        source = '''
          <p
            <!-- hoge
        '''
        context = {}
        expected = [
          tag: 'p'
          attrs: {}
          children: []
        ]
        template = bHtml source
        assert.deepEqual template(context), expected

  context 'doctype', ->
    context 'simple', ->
      it 'works', ->
        source = '''
          <!doctype html
        '''
        context = {}
        expected = []
        template = bHtml source
        assert.deepEqual template(context), expected

    context 'complex', ->
      it 'works', ->
        # no tests

  context 'element', ->
    context 'simple', ->
      it 'works', ->
        source = '''
          <p
        '''
        context = {}
        expected = [
          tag: 'p'
          attrs: {}
          children: []
        ]
        template = bHtml source
        assert.deepEqual template(context), expected

    context 'complex', ->
      it 'works', ->
        source = '''
          <p
            @class user
            <span
              @class user-name
              @b-text user.name
            <span
              @class user-email
              @b-text user.email
        '''
        context =
          user:
            name: 'bouzuya'
            email: '<EMAIL>'
        expected = [
          tag: 'p'
          attrs:
            class: 'user'
          children: [
            tag: 'span'
            attrs:
              class: 'user-name'
            children: ['bouzuya']
          ,
            tag: 'span'
            attrs:
              class: 'user-email'
            children: ['<EMAIL>']
          ]
        ]
        template = bHtml source
        assert.deepEqual template(context), expected
{'fraction_non_alphanumeric': 0.13284250960307298, 'fraction_numerical': 0.0, 'mean_word_length': 1.2178850248403124, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3357878', 'n_tokens_mistral': 823, 'n_tokens_neox': 804, 'n_words': 203}