<commit_before>var Greenbar = {

  go : function () {
    this.resultDisplayer = new Greenbar.ResultDisplayer();

    jQuery("#display-output").click(function () {
      var output = jQuery("#output");
      if (output.is(":hidden")) {
        output.show();
        jQuery(this).text("Hide Output");
      }
      else {
        output.hide();
        jQuery(this).text("Show Output");
      }
    });
    
    Greenbar.runTests();
  },

  runTests : function () {
    var resultDisplayer = this.resultDisplayer;
    jQuery.get('/results', function (data) {
      resultDisplayer.render(data);
    });
  }
  
};

Greenbar.ResultDisplayer = function () {
};

Greenbar.ResultDisplayer.prototype.renderTestCases = function (data) {

  var testCases = jQuery("#testcase-container");
  testCases.empty();

  var testList = $("<ul></ul>");
  for(var i = 0, l = data.tests.length; i < l; ++i) {
    var testResult = data.tests[i];
    var tmpl = $("#testcase").tmpl( data.tests[i] );

    tmpl.appendTo(testList);
  }

  testList.appendTo(testCases);  
};

Greenbar.ResultDisplayer.prototype.renderTestHeader = function (data) {
  var tmpl = $("#testheader").tmpl( data );
  var testHeader = jQuery("#testheader-container");
  testHeader.empty();

  tmpl.appendTo(testHeader);
};

Greenbar.ResultDisplayer.prototype.render = function (data) {
  var outputContainer = jQuery("#output");
  outputContainer.html("<pre>" + data.output + "</pre>");
  outputContainer.hide();
  
  jQuery("#nowtime").html(data.nowtime);

  this.renderTestCases(data);
  this.renderTestHeader(data);
};
<commit_msg>Show output when test failure/error.<commit_after>var Greenbar = {

  go : function () {
    this.resultDisplayer = new Greenbar.ResultDisplayer();

    jQuery("#display-output").click(function () {
      var output = jQuery("#output");
      if (output.is(":hidden")) {
        output.show();
        jQuery(this).text("Hide Output");
      }
      else {
        output.hide();
        jQuery(this).text("Show Output");
      }
    });
    
    Greenbar.runTests();
  },

  runTests : function () {
    var resultDisplayer = this.resultDisplayer;
    jQuery.get('/results', function (data) {
      resultDisplayer.render(data);
    });
  }
  
};

Greenbar.ResultDisplayer = function () {
};

Greenbar.ResultDisplayer.prototype.renderTestCases = function (data) {

  var testCases = jQuery("#testcase-container");
  testCases.empty();

  var testList = $("<ul></ul>");
  for(var i = 0, l = data.tests.length; i < l; ++i) {
    var testResult = data.tests[i];
    var tmpl = $("#testcase").tmpl( data.tests[i] );

    tmpl.appendTo(testList);
  }

  testList.appendTo(testCases);  
};

Greenbar.ResultDisplayer.prototype.renderTestHeader = function (data) {
  var tmpl = $("#testheader").tmpl( data );
  var testHeader = jQuery("#testheader-container");
  testHeader.empty();

  tmpl.appendTo(testHeader);
};

Greenbar.ResultDisplayer.prototype.render = function (data) {
  var outputContainer = jQuery("#output");
  outputContainer.html("<pre>" + data.output + "</pre>");
  outputContainer.hide();
  
  jQuery("#nowtime").html(data.nowtime);

  this.renderTestCases(data);
  this.renderTestHeader(data);
  
  if (data.errors > 0 || data.failures > 0) {
    jQuery("#display-output").click();
  }
};
{'fraction_non_alphanumeric': 0.17417783191230207, 'fraction_numerical': 0.001218026796589525, 'mean_word_length': 3.4153225806451615, 'pattern_counts': {'":': 2, '<': 13, '<?xml version=': 0, '>': 13, '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': '7086415', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1040, 'n_words': 178}