<commit_before>'use strict';

//
// TODO: Add regexp tests.
//


var util = require('util');
var assert = require('assert');
var subject = require('../lib/assert-full-equal');


describe('Functional', function () {

  function fullEqual(actual, expected) {
    assert.doesNotThrow(function () {
      subject.fullEqual(actual, expected);
    }, assert.AssertionError);
  }

  function notFullEqual(actual, expected) {
    assert.throws(function () {
      subject.fullEqual(actual, expected);
    }, assert.AssertionError);
  }

  it('should throw when the objects are of different types', function () {
    notFullEqual(42, 'answer');
    notFullEqual(false, null);
  });

  it('should pass when both of the objects are NaN', function () {
    fullEqual(NaN, NaN);
    notFullEqual(NaN, 42);
    notFullEqual(null, NaN);
  });

  it('should treat nulls', function () {
    fullEqual(null, null);
  });

  it('should treat numbers', function () {
    fullEqual(-346, -346);
    fullEqual(0, 0);
    fullEqual(2376, 2376);
    fullEqual(-672.234, -672.234);
    fullEqual(9.358546212888048e-14, 9.358546212888048e-14);
    notFullEqual(5, -5);
    notFullEqual(8234, 7823);
    notFullEqual(-564.23466, 0.236852109);
    notFullEqual(9.358546212888048e-14, 9.358546212888047e-14);
  });

  it('should treat strings', function () {
    fullEqual('hello world', 'hello world');
    notFullEqual('john', 'joe');
  });

  it('should treat flat arrays', function () {
    fullEqual([1, 2, 3, 4], [1, 2, 3, 4]);
    notFullEqual([2, 1, 4], [1, 2, 4]);
  });

  it('should treat nested arrays', function () {
    fullEqual([5, 6, [9, 3], 7], [5, 6, [9, 3], 7]);
    notFullEqual([7, 7, [3, 8, 1], 1], [7, 7, [], 1]);
  });

  it('should treat flat hash-like objects', function () {
    var object = {
      x: 12,
      y: 34,
      z: -3<commit_msg>Add tests for RegExps<commit_after>'use strict';

//
// TODO: Add regexp tests.
//


var util = require('util');
var assert = require('assert');
var subject = require('../lib/assert-full-equal');


describe('Functional', function () {

  function fullEqual(actual, expected) {
    assert.doesNotThrow(function () {
      subject.fullEqual(actual, expected);
    }, assert.AssertionError);
  }

  function notFullEqual(actual, expected) {
    assert.throws(function () {
      subject.fullEqual(actual, expected);
    }, assert.AssertionError);
  }

  it('should throw when the objects are of different types', function () {
    notFullEqual(42, 'answer');
    notFullEqual(false, null);
  });

  it('should pass when both of the objects are NaN', function () {
    fullEqual(NaN, NaN);
    notFullEqual(NaN, 42);
    notFullEqual(null, NaN);
  });

  it('should treat nulls', function () {
    fullEqual(null, null);
  });

  it('should treat numbers', function () {
    fullEqual(-346, -346);
    fullEqual(0, 0);
    fullEqual(2376, 2376);
    fullEqual(-672.234, -672.234);
    fullEqual(9.358546212888048e-14, 9.358546212888048e-14);
    notFullEqual(5, -5);
    notFullEqual(8234, 7823);
    notFullEqual(-564.23466, 0.236852109);
    notFullEqual(9.358546212888048e-14, 9.358546212888047e-14);
  });

  it('should treat strings', function () {
    fullEqual('hello world', 'hello world');
    notFullEqual('john', 'joe');
  });

  it('should treat regexps', function () {
    fullEqual((/hello/i), (/hello/i));
    fullEqual((/hello\s+[wv]orlds?/g), (/hello\s+[wv]orlds?/g));
    notFullEqual((/hello/i), (/world/i));
    notFullEqual((/rain/i), (/rain/ig));
  });

  it('should treat flat arrays', function () {
    fullEqual([1, 2, 3, 4], [1, 2, 3, 4]);
    notFullEqual([2, 1, 4], [1, 2, 4]);
  });

  it('should treat nested arrays', function () {
    fullEqual([5, 6, [9, 3], 7], [5, 6, [9, 3], 7]);
    notFullEqual([7, 7, [3, 8, 1], 1], [7, 7, [], 1]);
  });

  it('should treat flat hash-like objects', function () {
    var object = {
      x: 12,
      y: 34,
      z: -3
{'fraction_non_alphanumeric': 0.1868159837108679, 'fraction_numerical': 0.08653601425299058, 'mean_word_length': 3.328193832599119, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6495287', 'n_tokens_mistral': 1616, 'n_tokens_neox': 1370, 'n_words': 326}