<commit_before>function Testor(collab) {
  
  var testNodes = {};
  var container = $('#testorcontainer');
  
  function onTestToggleTrace(div) {
    $('.testtrace', div).toggle("fast");
  }
  
  function onTestUpdateStatus(test, result) {
    collab.sendExtendedMessage({
      type: "TESTS_REQUEST",
      action: "update",
      test: test,
      from: result.status
    });
  }
  
  var testor = {};
  
  testor.updateTest = function(test, result) {
    var node;
    if (test.name in testNodes) {
      node = testNodes[test.name];
      if (( ! result) || ( ! result.resultName)) {
        delete testNodes[test.name];
        node.remove();
        return;
      }
    } else {
      if (( ! result) || ( ! result.resultName)) {
        return;
      }
      
      node = $('<div>');
      testNodes[test.name] = node;
      
      node.append($('<div class="extra top"></div><div class="extra left"></div><div class="extra right"></div>'));
      node.append($('<div>').addClass('testclass').text(test.className));
      node.append($('<div>').addClass('testmethod').append($('<a>').attr('href', '#').text(test.methodName).click(function() {
        return Layout.hoverOpen('/coverage/' + clientVars.editorProject + ':' + test.name);
      })));
      
      node.append($('<button>').html('<div></div>'));
      
      node.append($('<a>').addClass('toggle').html('<div></div>').click(function() { onTestToggleTrace(node); }));
      var trace = $('<div>').addClass('testtrace');
      trace.append($('<table><tr><td class="expected"></td><td class="actual"></td></tr><tr><td colspan="2" class="stackTrace"></td></tr></table>'));
      node.append(trace);
      
      container.append(node);
    }
    node.attr('class', 'test');<commit_msg>Order tests alphabetically by name, which might be better than random<commit_after>function Testor(collab) {
  
  var testNodes = {};
  var container = $('#testorcontainer');
  
  function onTestToggleTrace(div) {
    $('.testtrace', div).toggle("fast");
  }
  
  function onTestUpdateStatus(test, result) {
    collab.sendExtendedMessage({
      type: "TESTS_REQUEST",
      action: "update",
      test: test,
      from: result.status
    });
  }
  
  var testor = {};
  
  testor.updateTest = function(test, result) {
    var node;
    if (test.name in testNodes) {
      node = testNodes[test.name];
      if (( ! result) || ( ! result.resultName)) {
        delete testNodes[test.name];
        node.remove();
        return;
      }
    } else {
      if (( ! result) || ( ! result.resultName)) {
        return;
      }
      
      node = $('<div>').data('testname', test.name);
      testNodes[test.name] = node;
      
      node.append($('<div class="extra top"></div><div class="extra left"></div><div class="extra right"></div>'));
      node.append($('<div>').addClass('testclass').text(test.className));
      node.append($('<div>').addClass('testmethod').append($('<a>').attr('href', '#').text(test.methodName).click(function() {
        return Layout.hoverOpen('/coverage/' + clientVars.editorProject + ':' + test.name);
      })));
      
      node.append($('<button>').html('<div></div>'));
      
      node.append($('<a>').addClass('toggle').html('<div></div>').click(function() { onTestToggleTrace(node); }));
      var trace = $('<div>').addClass('testtrace');
      trace.append($('<table><tr><td class="expected"></td><td class="actual"></td></tr><tr><td colspan="2" class="stackTrace"></td></tr></table>'));
      node.append(trace);
      
      container.children().each(function(idx) {
        if ($(this).data('testname') > test.name) {
          node.insertBefore(this);
          return false;
        }
      });
      if ( ! node.parent().length) { container.append(node); }
    }
    node.attr('class', 'test');
{'fraction_non_alphanumeric': 0.215, 'fraction_numerical': 0.0005263157894736842, 'mean_word_length': 2.9470404984423677, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 62, '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': '4857686', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1165, 'n_words': 181}