<commit_before>let assert = require("assert");
let Card = require("../lib/Card");
let Pair = require("../lib/Pair");
let Deck = require("../lib/Deck");
let deckGenerator = require("../lib/deckGenerator");
let debug = require('debug')('deckGenerator');


describe('deckGenerator()', () => {
  it(`should return a function when called with no arguments`, () => {
    let generateDeck = deckGenerator();
    assert.equal('function', typeof generateDeck);
  });

  it(`should throw an error when called with anything other than a function`, () => {
    assert.throws(() => deckGenerator(42));
    assert.throws(() => deckGenerator("42"));
    assert.throws(() => deckGenerator([42]));
  });

  describe('deckGenerator().generateSymbol', () => {
    it(`should return a function when called without arguments`, () => {
      let generateDeck = deckGenerator();
      assert.equal('function', typeof generateDeck.generateSymbol);
    });
  });

  describe('deckGenerator()()', () => {
    let tests = [{
      dimensions: 2,
      expectedCards: 3,
      expectedSymbols: 3
    }, {
      dimensions: 3,
      expectedCards: 7,
      expectedSymbols: 7
    },{
      dimensions: 4,
      expectedCards: 13,
      expectedSymbols: 13
    }, {
      dimensions: 5,
      expectedCards: 21,
      expectedSymbols: 21
    }, {
      dimensions: 6,
      expectedCards: 31,
      expectedSymbols: 31
    }, {
      dimensions: 7,
      expectedCards: 43,
      expectedSymbols: 43
    }, {
      dimensions: 8,
      expectedCards: 57,
      expectedSymbols: 57
    }, {
      dimensions: 9,
      expectedCards: 73,
      expectedSymbols: 73
    }];

    tests.forEach(test => {
      it(`should return a deck with valid cards and pairs when called with ${test.dimensions}`, () => {
        let generateDeck = deckGenerator();
        let deck = generateDeck(test.dimensions);

        debug(`${deck}`);

        assert.ok(deck.isValid());
        let cards = deck.cards;

        assert.equal(test.expectedCards, cards.length, `Expected ${test.expectedCards} cards, found ${cards.length}`);

        let invalidCards = cards.filter(c => {
          return c.symbols.length == test.expectedSymbols;
        });

        assert.equal(0, invalidCards.length, `Found ${invalidCards.length} invalid cards\n${invalidCards.join('\n')}`);
      });
    });
  });
});<commit_msg>Standardization of loggers names. Deck generation working except for dimensions 5, 7 and 9<commit_after>let assert = require("assert");
let Card = require("../lib/Card");
let Pair = require("../lib/Pair");
let Deck = require("../lib/Deck");
let deckGenerator = require("../lib/deckGenerator");
let debug = require('debug')('deckGenerator');


describe('deckGenerator()', () => {
  it(`should return a function when called with no arguments`, () => {
    let generateDeck = deckGenerator();
    assert.equal('function', typeof generateDeck);
  });

  it(`should throw an error when called with anything other than a function`, () => {
    assert.throws(() => deckGenerator(42));
    assert.throws(() => deckGenerator("42"));
    assert.throws(() => deckGenerator([42]));
  });

  describe('deckGenerator().generateSymbol', () => {
    it(`should return a function when called without arguments`, () => {
      let generateDeck = deckGenerator();
      assert.equal('function', typeof generateDeck.generateSymbol);
    });
  });

  describe('deckGenerator()()', () => {
    let tests = [/*{
      dimensions: 2,
      expectedCards: 3,
      expectedSymbols: 3
    }, {
      dimensions: 3,
      expectedCards: 7,
      expectedSymbols: 7
    },{
      dimensions: 4,
      expectedCards: 13,
      expectedSymbols: 13
    }, */{
      dimensions: 5,
      expectedCards: 21,
      expectedSymbols: 21
    }, /*{
      dimensions: 6,
      expectedCards: 31,
      expectedSymbols: 31
    }, */{
      dimensions: 7,
      expectedCards: 43,
      expectedSymbols: 43
    }, /*{
      dimensions: 8,
      expectedCards: 57,
      expectedSymbols: 57
    }, */{
      dimensions: 9,
      expectedCards: 73,
      expectedSymbols: 73
    }];

    tests.forEach(test => {
      it(`should return a deck with valid cards and pairs when called with ${test.dimensions}`, () => {
        let generateDeck = deckGenerator();
        let deck = generateDeck(test.dimensions);

        debug(`${deck}`);

        assert.ok(deck.isValid());
        let cards = deck.cards;

        assert.equal(test.expectedCards, cards.length, `Expected ${test.expectedCards} cards, found ${cards.length}`);

        let invalidCards = cards.filter(c => {
          return c.symbols.length == test.expectedSymbols;
        });

        assert.equal(0, invalidCards.length, `Found ${invalidCards.length} invalid cards\n${invalidCards.join('\n')}`);
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.15755560174599875, 'fraction_numerical': 0.018499272500519644, 'mean_word_length': 2.816019032513878, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '316116', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1387, 'n_words': 337}