<commit_before>var grunt = require('../../lib/grunt');
var task = grunt.task;
var file = grunt.file;
var utils = grunt.utils;
var config = grunt.config;
var template = grunt.template;

exports['config'] = function(test) {
  test.expect(2);
  test.deepEqual(grunt.helper('config'), config(), 'It should just pass through to config.');
  test.deepEqual(grunt.helper('config', 'meta'), config('meta'), 'It should just pass through to config.');
  test.done();
};

exports['json'] = function(test) {
  test.expect(2);
  var obj = grunt.helper('json', 'test/fixtures/test.json');
  test.equal(obj.foo, 'bar', 'JSON properties should be available as-defined.');
  test.deepEqual(obj.baz, [1, 2, 3], 'JSON properties should be available as-defined.');
  test.done();
};

exports['strip_banner'] = function(test) {
  test.expect(7);
  var src = file.read('test/fixtures/banner.js');
  test.equal(grunt.helper('strip_banner', src), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {bang: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  src = file.read('test/fixtures/banner2.js');
  test.equal(grunt.helper('strip_banner', src), '\n/*! SAMPLE\n * BANNER */\n\n// Comment\n\n/* Comment */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {bang: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  src = file.read('test/fixtures/banner3.js');
  test.equal(grunt.helper('strip_banner', src), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {bang: true}), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {line: true}), '// But this is not\n\n/* And neither\n * is this\n */\n', 'It should strip the top banner.');
  test.done();
};

exports['file_strip_banner'] = function(test) {
  test.expect(14);
  var filepath = 'test/fixtures/banner.js';
  test.equal(grunt.helper('file_strip_banner', filepath), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {bang: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  filepath = 'test/fixtures/banner2.js';
  test.equal(grunt.helper('file_strip_banner', filepath), '\n/*! SAMPLE\n * BANNER */\n\n// Comment\n\n/* Comment */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {bang: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  filepath = 'test/fixtures/banner3.js';
  test.equal(grunt.helper('file_strip_banner', filepath), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {bang: true}), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {line: true}), '// But this is not\n\n/* And neither\n * is this\n */\n', 'It should strip the top banner.');

  test.equal(task.directive('<file_strip_banner:test/fixtures/banner.js>'), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner.js:bang>'), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner2.js>'), '\n/*! SAMPLE\n * BANNER */\n\n// Comment\n\n/* Comment */\n', 'It should not strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner2.js:bang>'), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner3.js>'), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner3.js:bang>'), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner3.js:line>'), '// But this is not\n\n/* And neither\n * is this\n */\n', 'It should strip the top banner.');
  test.done();
};<commit_msg>Gruntfail. Forgot to commit unit tests for the last fix.<commit_after>var grunt = require('../../lib/grunt');
var task = grunt.task;
var file = grunt.file;
var utils = grunt.utils;
var config = grunt.config;
var template = grunt.template;

exports['config'] = function(test) {
  test.expect(2);
  test.deepEqual(grunt.helper('config'), config(), 'It should just pass through to config.');
  test.deepEqual(grunt.helper('config', 'meta'), config('meta'), 'It should just pass through to config.');
  test.done();
};

exports['json'] = function(test) {
  test.expect(2);
  var obj = grunt.helper('json', 'test/fixtures/test.json');
  test.equal(obj.foo, 'bar', 'JSON properties should be available as-defined.');
  test.deepEqual(obj.baz, [1, 2, 3], 'JSON properties should be available as-defined.');
  test.done();
};

exports['strip_banner'] = function(test) {
  test.expect(7);
  var src = file.read('test/fixtures/banner.js');
  test.equal(grunt.helper('strip_banner', src), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {block: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  src = file.read('test/fixtures/banner2.js');
  test.equal(grunt.helper('strip_banner', src), '\n/*! SAMPLE\n * BANNER */\n\n// Comment\n\n/* Comment */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {block: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  src = file.read('test/fixtures/banner3.js');
  test.equal(grunt.helper('strip_banner', src), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {block: true}), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('strip_banner', src, {line: true}), '// But this is not\n\n/* And neither\n * is this\n */\n', 'It should strip the top banner.');
  test.done();
};

exports['file_strip_banner'] = function(test) {
  test.expect(14);
  var filepath = 'test/fixtures/banner.js';
  test.equal(grunt.helper('file_strip_banner', filepath), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {block: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  filepath = 'test/fixtures/banner2.js';
  test.equal(grunt.helper('file_strip_banner', filepath), '\n/*! SAMPLE\n * BANNER */\n\n// Comment\n\n/* Comment */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {block: true}), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  filepath = 'test/fixtures/banner3.js';
  test.equal(grunt.helper('file_strip_banner', filepath), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {block: true}), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(grunt.helper('file_strip_banner', filepath, {line: true}), '// But this is not\n\n/* And neither\n * is this\n */\n', 'It should strip the top banner.');

  test.equal(task.directive('<file_strip_banner:test/fixtures/banner.js>'), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner.js:block>'), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner2.js>'), '\n/*! SAMPLE\n * BANNER */\n\n// Comment\n\n/* Comment */\n', 'It should not strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner2.js:block>'), '// Comment\n\n/* Comment */\n', 'It should strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner3.js>'), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner3.js:block>'), '\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n', 'It should not strip the top banner.');
  test.equal(task.directive('<file_strip_banner:test/fixtures/banner3.js:line>'), '// But this is not\n\n/* And neither\n * is this\n */\n', 'It should strip the top banner.');
  test.done();
};
{'fraction_non_alphanumeric': 0.20715350223546944, 'fraction_numerical': 0.003619331488183947, 'mean_word_length': 3.837796086508754, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4518677', 'n_tokens_mistral': 3385, 'n_tokens_neox': 3378, 'n_words': 889}