<commit_before>/* global casper */

casper.on("page.error", function(msg, trace) {
  this.echo("Error:    " + msg, "ERROR");
  this.echo("file:     " + trace[0].file, "WARNING");
  this.echo("line:     " + trace[0].line, "WARNING");
  this.echo("function: " + trace[0].function, "WARNING");
});

casper.on("remote.message", function(msg) {
    this.echo("Console message: " + msg);
});

casper.test.begin("Box Tests", function(test) {

  casper
    .start("http://localhost:4000/test/browser/box.html", function(){

      test.assertElementCount("svg", 1, "Automatically added <svg> element to page.");
      test.assertElementCount("text", 1, "Created <text> container element.");
      test.assertElementCount("tspan", 2, "Created 2 <tspan> elements.");
      test.assertEval(function(){
        var tspans = document.body.getElementsByTagName("tspan");

        function getText(t) {
          return t.textContent || t.innerText;
        }

        return getText(tspans[0]) === "Hello D3plus, please wrap" &&
               getText(tspans[1]) === "this sentence for me.";
      }, "Wrapped text correctly.");

    })
    .run(function(){
      test.done();
    });
});<commit_msg>another potential test fix<commit_after>/* global casper */

casper.on("page.error", function(msg, trace) {
  this.echo("Error:    " + msg, "ERROR");
  this.echo("file:     " + trace[0].file, "WARNING");
  this.echo("line:     " + trace[0].line, "WARNING");
  this.echo("function: " + trace[0].function, "WARNING");
});

casper.on("remote.message", function(msg) {
    this.echo("Console message: " + msg);
});

casper.test.begin("Box Tests", function(test) {

  casper
    .start("http://localhost:4000/test/browser/box.html", function(){

      test.assertElementCount("svg", 1, "Automatically added <svg> element to page.");
      test.assertElementCount("text", 1, "Created <text> container element.");
      test.assertElementCount("tspan", 2, "Created 2 <tspan> elements.");
      test.assertEval(function(){
        var tspans = this.document.getElementsByTagName("tspan");

        function getText(t) {
          return t.textContent || t.innerText;
        }

        return getText(tspans[0]) === "Hello D3plus, please wrap" &&
               getText(tspans[1]) === "this sentence for me.";
      }, "Wrapped text correctly.");

    })
    .run(function(){
      test.done();
    });
});
{'fraction_non_alphanumeric': 0.18967687788501889, 'fraction_numerical': 0.01174989509022241, 'mean_word_length': 3.226950354609929, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6232139', 'n_tokens_mistral': 771, 'n_tokens_neox': 741, 'n_words': 151}