<commit_before>var vows = require('vows');
var assert = require('assert');
var distinguishable = require('../');

console.log(distinguishable.create(8));
console.log(distinguishable.parse("CNoBPRsR"));

vows.describe('distinguishable').addBatch({
    'when generating passwords': {
        'of negative length': {
            topic: function () { return distinguishable.create(-1); },

            'we get a zero-length string': function (topic) {
                assert.equal(topic.length, 0);
            }
        },

        'of zero length': {
            topic: function () { return distinguishable.create(0); },

            'we get a zero-length string': function (topic) {
                assert.equal(topic.length, 0);
            }
        },

        'of length 1': {
            topic: function () { return distinguishable.create(1); },

            'we get a string with one character only': function (topic) {
                assert.equal(topic.length, 1);
            }
        },

        'of length 123': {
            topic: function () { return distinguishable.create(123); },

            'we get a string with 123 characters': function (topic) {
                assert.equal(topic.length, 123);
            }
        }
    }
}).run();<commit_msg>Added some tests<commit_after>var vows = require('vows');
var assert = require('assert');
var distinguishable = require('../');

vows.describe('distinguishable').addBatch({
    'when generating passwords': {
        'of negative length': {
            topic: function () { return distinguishable.create(-1); },

            'we get a zero-length string': function (topic) {
                assert.equal(topic.length, 0);
            }
        },

        'of zero length': {
            topic: function () { return distinguishable.create(0); },

            'we get a zero-length string': function (topic) {
                assert.equal(topic.length, 0);
            }
        },

        'of length 1': {
            topic: function () { return distinguishable.create(1); },

            'we get a string with one character only': function (topic) {
                assert.equal(topic.length, 1);
            }
        },

        'of length 123': {
            topic: function () { return distinguishable.create(123); },

            'we get a string with 123 characters': function (topic) {
                assert.equal(topic.length, 123);
            }
        },

        'ASD to 45D': {
            topic: function () { return distinguishable.parse("ASD"); },
            'we want to get 45D': function (topic) {
                assert.equal(topic, "45D")
            }
        },

        'asd to 45D': {
            topic: function () { return distinguishable.parse("asd"); },
            'we want to get 45D': function (topic) {
                assert.equal(topic, "45D")
            }
        }
    }
}).run();
{'fraction_non_alphanumeric': 0.13850415512465375, 'fraction_numerical': 0.017659279778393353, 'mean_word_length': 1.7619502868068833, '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': '597948', 'n_tokens_mistral': 821, 'n_tokens_neox': 730, 'n_words': 201}