<commit_before>'use strict';

var assert = require('assert');
var fs = require('fs');

var transform = require('../');

var failed = false;

function assertEqual(output, expected) {
  console.log('\tOutput:  ', JSON.stringify(output));
  console.log('\tExpected:', JSON.stringify(expected));
  if (output !== expected) {
    console.log('\tFAILED');
    failed = true;
  } else {
    console.log('\tPASSED');
  }
}

var input = fs.readFileSync(__dirname + '/input.eco', 'utf8');
var expected = fs.readFileSync(__dirname + '/expected.html', 'utf8');

var options = {
  heading: 'Heading 1',
  bullets: [
    "Bullet 1",
    "Bullet 2"
  ]
}
var output = transform.render(input, options);
fs.writeFileSync(__dirname + '/output.html', output);
assertEqual(output, expected);

console.log('test passed');<commit_msg>Fix test<commit_after>'use strict';

var assert = require('assert');
var fs = require('fs');

var transform = require('../');

var failed = false;

function assertEqual(output, expected) {
  console.log('\tOutput:  ', JSON.stringify(output));
  console.log('\tExpected:', JSON.stringify(expected));
  if (output !== expected) {
    console.log('\tFAILED');
    failed = true;
  } else {
    console.log('\tPASSED');
  }
}

var input = fs.readFileSync(__dirname + '/input.eco', 'utf8');
var expected = fs.readFileSync(__dirname + '/expected.html', 'utf8');

var locals = {
  heading: 'Heading 1',
  bullets: [
    "Bullet 1",
    "Bullet 2"
  ]
}
var output = transform.compile(input)(locals);
fs.writeFileSync(__dirname + '/output.html', output);
assertEqual(output, expected);

if (failed) {
  console.log('tests FAILED');
  process.exit(1);
} else {
  console.log('tests PASSED');
}
{'fraction_non_alphanumeric': 0.18691037735849056, 'fraction_numerical': 0.006485849056603774, 'mean_word_length': 4.286604361370716, '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': '4375213', 'n_tokens_mistral': 564, 'n_tokens_neox': 565, 'n_words': 125}