<commit_before>#!/usr/bin/env node

'use strict';

var clean = require('../');
var expect = require('chai').expect;

var node_path = require('path');
var node_url = require('url');

var schema = {
  cwd: {
    type: node_path
  },

  a: {
    type: Boolean
  },

  url: {
    type: node_url
  }
};

var shorthands = {
  'c': 'cwd'
}

describe(".parse()", function() {
  it("complex", function(done) {
    clean({
      schema: schema,
      shorthands: shorthands

    }).parse(['node', 'my command', '-c', 'abc', '-a', '--url', 'abc'], function(err, results, details) {
      done();
      expect(err).not.to.equal(null);
      expect(results.cwd).to.equal(node_path.resolve('abc'));
      expect(details.url.error).not.to.equal(null);
    });
  });
});


describe(".argv(argv)", function(){
  it("#12: boolean type", function(){
    var data = clean({
      schema: {
        boolean: {
          type: Boolean
        },
        blah: {
          type: Boolean
        },
        boo: {

        }<commit_msg>updates test cases; #13<commit_after>#!/usr/bin/env node

'use strict';

var clean = require('../');
var expect = require('chai').expect;

var node_path = require('path');
var node_url = require('url');

var schema = {
  cwd: {
    type: node_path
  },

  a: {
    type: Boolean
  },

  url: {
    type: node_url
  }
};

var shorthands = {
  'c': 'cwd'
}

describe(".parse()", function() {
  it("complex", function(done) {
    clean({
      schema: schema,
      shorthands: shorthands

    }).parse(['node', 'my command', '-c', 'abc', '-a', '--url', 'abc'], function(err, results, details) {
      done();
      expect(err).not.to.equal(null);
      expect(results.cwd).to.equal(node_path.resolve('abc'));
      expect(details.url.error).not.to.equal(null);
    });
  });

  it("#13, default value", function(done){
    var schema = {
      cwd: {
        type: node_path
      },

      a: {
        type: Boolean,
        default: true
      },

      url: {
        type: node_url
      }
    };

    clean({
      schema: schema,
      shorthands: shorthands

    }).parse(['node', 'my command', '-c', 'abc', '--url', 'abc'], function(err, results, details) {
      done();
      expect(err).not.to.equal(null);
      expect(results.cwd).to.equal(node_path.resolve('abc'));
      expect(results.a).to.equal(true);
      expect(details.url.error).not.to.equal(null);
    });
  });
});


describe(".argv(argv)", function(){
  it("#12: boolean type", function(){
    var data = clean({
      schema: {
        boolean: {
          type: Boolean
        },
        blah: {
          type: Boolean
        },
        boo: {

        }
{'fraction_non_alphanumeric': 0.19727891156462585, 'fraction_numerical': 0.0030234315948601664, 'mean_word_length': 2.288198757763975, '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': '3773331', 'n_tokens_mistral': 921, 'n_tokens_neox': 889, 'n_words': 184}