<commit_before>"use strict";

function getTests(){
  var tests = [];
  tests = tests.concat(getArenaTests());
  tests = tests.concat(getGeometryTests());
  tests = tests.concat(getFunTests());
  tests = tests.concat(getFlockTests());
  tests = tests.concat(getBoidsTests());
  document.getElementById("testResults").innerHTML = "found " + tests.length + " tests";
  return tests;
}

function runTests(tests, results){
  if(tests === undefined){
    tests = getTests();
  }
  if(results === undefined){
    results = [];
  }
  if(tests.length == 0){
    showTestResults(results);
    return;
  }

  var result;
  try{
    result = tests[0].call(null);
  }catch(err){
    result = tests[0].toString().split("(")[0] + " caused error: " + err.message;
  }
  var newResults = results.slice(0);
  if(result != true){
    newResults.push(result);
  }
  return runTests(tests.slice(1), newResults);
}
<commit_msg>Display name of test in results<commit_after>"use strict";

function getTests(){
  var tests = [];
  tests = tests.concat(getArenaTests());
  tests = tests.concat(getGeometryTests());
  tests = tests.concat(getFunTests());
  tests = tests.concat(getFlockTests());
  tests = tests.concat(getBoidsTests());
  document.getElementById("testResults").innerHTML = "found " + tests.length + " tests";
  return tests;
}

function runTests(tests, results){
  if(tests === undefined){
    tests = getTests();
  }
  if(results === undefined){
    results = [];
  }
  if(tests.length == 0){
    showTestResults(results);
    return;
  }

  var result;
  try{
    result = tests[0].call(null);
  }catch(err){
    result = tests[0].toString().split("(")[0] + " caused error: " + err.message + " (" + err.lineNumber + ")";
  }
  var newResults = results.slice(0);
  if(result != true){
    //newResults.push(result);
    newResults.push(tests[0].toString().split("(")[0] + ": " + result);
  }
  return runTests(tests.slice(1), newResults);
}

{'fraction_non_alphanumeric': 0.18322981366459629, 'fraction_numerical': 0.007246376811594203, 'mean_word_length': 3.969151670951157, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, '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': '4841728', 'n_tokens_mistral': 630, 'n_tokens_neox': 625, 'n_words': 120}