<commit_before>;((rc) => {
  'use strict';
  var tagContent = 'router3';
  var tagSrc = 'router3-src';

  var div = document.createElement('div');
  div.innerHTML = `
    <${tagContent} hash="case8" src="/test/case8/case8-external.html">
    </${tagContent}>
  `;

  var async1 = async_test('Case 8: hash changed to content[hash="case8"] and imports from "case8-external.html"');
  var async2 = async_test('Case 8: repeat last test and see if case8-external.html has been fetched once');

  async1.next = async1.step_func(_ => {
    var hash = "case8";
    var content = document.querySelector(`${tagContent}[hash="${hash}"]`);

    var check_hash = async1.step_func((e) => {
      assert_false(content.hidden);

      var src = content.querySelector(`${tagSrc}`);
      assert_true(src instanceof HTMLElement);
      assert_equals(src.textContent, 'This is an external content\n');

      // clean the test
      window.location.hash = '';

      async1.done();
      async2.next();
    });

    content.addEventListener('show', check_hash);
    window.location.hash = hash;
  });

  async2.next = async2.step_func(_ => {
    var hash = "case8";
    var content = document.querySelector(`${tagContent}[hash="${hash}"]`);

    var check_hash = async2.step_func((e) => {
      assert_false(content.hidden);

      var src = content.querySelector(`${tagSrc}`);
      assert_true(src instanceof HTMLElement);
      assert_equals(src.textContent, 'This is an external content\n');

      // clean the test
      window.removeEventListener('hashchange', check_hash);
      document.body.removeChild(div);
      window.location.hash = '';

      async2.done();
      rc.next();
    });

    content.addEventListener('show', check_hash);
    window.location.hash = hash;
  });

  rc.push(_ => {<commit_msg>Add a failing test for load event<commit_after>;((rc) => {
  'use strict';
  var tagContent = 'router3';
  var tagSrc = 'router3-src';

  var div = document.createElement('div');
  div.innerHTML = `
    <${tagContent} hash="case8" src="/test/case8/case8-external.html">
    </${tagContent}>
  `;

  var async1 = async_test('Case 8: hash changed to content[hash="case8"] and imports from "case8-external.html"');
  var async2 = async_test('Case 8: repeat last test and see if case8-external.html has been fetched once');
  var async3 = async_test('Case 8: listen event "load" at content[hash="case8"]');

  async1.next = async1.step_func(_ => {
    var hash = "case8";
    var content = document.querySelector(`${tagContent}[hash="${hash}"]`);

    var check_hash = async1.step_func((e) => {
      assert_false(content.hidden);

      var src = content.querySelector(`${tagSrc}`);
      assert_true(src instanceof HTMLElement);
      assert_equals(src.textContent, 'This is an external content\n');

      // clean the test
      window.location.hash = '';

      async1.done();
      async2.next();
    });

    var check_load =  async3.step_func(_ => {
      content.removeEventListener('load', check_load);
      async3.done();
    });

    content.addEventListener('show', check_hash);
    content.addEventListener('load', check_load);
    window.location.hash = hash;
  });

  async2.next = async2.step_func(_ => {
    var hash = "case8";
    var content = document.querySelector(`${tagContent}[hash="${hash}"]`);

    var check_hash = async2.step_func((e) => {
      assert_false(content.hidden);

      var src = content.querySelector(`${tagSrc}`);
      assert_true(src instanceof HTMLElement);
      assert_equals(src.textContent, 'This is an external content\n');

      // clean the test
      window.removeEventListener('hashchange', check_hash);
      document.body.removeChild(div);
      window.location.hash = '';

      async2.done();
      rc.next();
    });

    content.addEventListener('show', check_hash);
    window.location.hash = hash;
  });

  rc.push(_ => {
{'fraction_non_alphanumeric': 0.15893869139618752, 'fraction_numerical': 0.01313755795981453, 'mean_word_length': 3.3776775648252535, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 20, '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': '3995368', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1193, 'n_words': 255}