<commit_before>/*
 * Copyright 2013 The Toolkitchen Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file.
 */

// if standalone
if (window.top === window) {
  window.done = function() {
    alert('Test Passed');
  }
  window.onerror = function(x) {
    alert('Test FAILED: ' + x);
  };
} else
// if part of a test suite
{
  window.done = function() {
    parent.postMessage('ok', '*');
  }
  window.onerror = function(x) {<commit_msg>try banners instead of alerting<commit_after>/*
 * Copyright 2013 The Toolkitchen Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file.
 */

// if standalone
if (window.top === window) {
  // if standalone
  window.done = function() {
    var d = document.createElement('pre');
    d.style.cssText = 'padding: 6px; background-color: lightgreen;';
    d.textContent = 'Passed';
    document.body.insertBefore(d, document.body.firstChild);
  }
  window.onerror = function(x) {
    var d = document.createElement('pre');
    d.style.cssText = 'padding: 6px; background-color: #FFE0E0;';
    d.textContent = 'FAILED: ' + x + '\n\n' + lastError.stack;
    document.body.insertBefore(d, document.body.firstChild);
  };
} else
// if part of a test suite
{
  window.done = function() {
    parent.postMessage('ok', '*');
  }
  window.onerror = function(x) {
{'fraction_non_alphanumeric': 0.14414414414414414, 'fraction_numerical': 0.008316008316008316, 'mean_word_length': 3.31044776119403, 'pattern_counts': {'":': 0, '<': 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': '3787016', 'n_tokens_mistral': 473, 'n_tokens_neox': 458, 'n_words': 136}