<commit_before>/* globals describe it beforeEach afterEach */

require('should');
var Dictionary = require('../');

describe('Dictionary Unit Tests', function() {
    var dict;

    beforeEach(function () {
        dict = new Dictionary();
    });

    afterEach(function () {
        dict = null;
    });

    it('should have a working test environment', function() {
        true.should.equal(true);
    });

    it('should instantiate a dictionary instance', function () {
        dict.should.be.ok;
        dict.should.be.instanceof(Dictionary);
    });

    it('should be empty when first instantiated', function () {
        dict.isEmpty().should.equal(true);
        dict.size().should.equal(0);
    });
});
<commit_msg>add some unit tests<commit_after>/* globals describe it beforeEach afterEach */

require('should');
var Dictionary = require('../');

describe('Dictionary Unit Tests', function() {
    var dict;

    beforeEach(function () {
        dict = new Dictionary();
    });

    afterEach(function () {
        dict = null;
    });

    it('should have a working test environment', function() {
        true.should.equal(true);
    });

    it('should instantiate a dictionary instance', function () {
        dict.should.be.ok;
        dict.should.be.instanceof(Dictionary);
    });

    it('should be empty when first instantiated', function () {
        dict.isEmpty().should.equal(true);
        dict.size().should.equal(0);
    });

    it('should add items to the dictionary', function () {
        dict.set('dict', 'data structure');
        dict.set('set', 'another data structure');
        dict.size().should.equal(2);
    });

    it('should determine if the dictionary has a particular key', function () {
        dict.set('dict', 'data structure');
        dict.set('set', 'another data structure');
        dict.has('dict').should.equal(true);
        dict.has('set').should.equal(true);
    });

    it('should correctly remove an item', function () {
        dict.set('dict', 'data structure');
        dict.set('set', 'another data structure');
        dict.remove('dict').should.equal(true);
        dict.size().should.equal(1);
        dict.remove('nothing').should.equal(false);
    });

    it('should correctly get an item', function () {
        dict.set('dict', 'data structure');
        dict.set('set', 'another data structure');
        dict.get('dict').should.equal('data structure');
        dict.get('set').should.equal('another data structure');
        dict.get('nothing').should.equal(-1);
    });
});

{'fraction_non_alphanumeric': 0.16797180892717306, 'fraction_numerical': 0.001957713390759593, 'mean_word_length': 2.751835535976505, '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': '2230843', 'n_tokens_mistral': 715, 'n_tokens_neox': 687, 'n_words': 168}