<commit_before>var shell = require('..');

var assert = require('assert'),
    path = require('path'),
    fs = require('fs');

// Node shims for < v0.7
fs.existsSync = fs.existsSync || path.existsSync;

shell.silent(true);

shell.rm('-rf', 'tmp');
shell.mkdir('tmp')

//
// Invalids
//

var result = shell.test(); // no expression given
assert.ok(shell.error());

var result = shell.test('asdf'); // bad expression
assert.ok(shell.error());

var result = shell.test('f', 'resources/file1'); // bad expression
assert.ok(shell.error());

var result = shell.test('-f'); // no file
assert.ok(shell.error());

//
// Valids
//

//exists
var result = shell.test('-e', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, true);

//block
var result = shell.test('-b', 'resources/block');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

var result = shell.test('-c', 'resources/block');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-d', 'resources/block');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-f', 'resources/block');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-L', 'resources/block');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-p', 'resources/block');
assert.equal(shell.error(), null);
assert.equal(result, false);

//character
var result = shell.test('-b', 'resources/character');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-c', 'resources/character');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

var result = shell.test('-d', 'resources/character');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-f', 'resources/character');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-L', 'resources/character');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-p', 'resources/character');
assert.equal(shell.error(), null);
assert.equal(result, false);

//directory
var result = shell.test('-b', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-c', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-d', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

var result = shell.test('-f', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-L', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-p', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, false);

//file
var result = shell.test('-b', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-c', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-d', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-f', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

var result = shell.test('-L', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-p', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, false);

//link
var result = shell.test('-b', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-c', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-d', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-f', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-L', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

var result = shell.test('-p', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, false);

//pipe
var result = shell.test('-b', 'resources/pipe');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-c', 'resources/pipe');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-d', 'resources/pipe');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-f', 'resources/pipe');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-L', 'resources/pipe');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-p', 'resources/pipe');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

shell.exit(123);<commit_msg>rm tests for block, character, fifo files<commit_after>var shell = require('..');

var assert = require('assert'),
    path = require('path'),
    fs = require('fs');

// Node shims for < v0.7
fs.existsSync = fs.existsSync || path.existsSync;

shell.silent(true);

shell.rm('-rf', 'tmp');
shell.mkdir('tmp')

//
// Invalids
//

var result = shell.test(); // no expression given
assert.ok(shell.error());

var result = shell.test('asdf'); // bad expression
assert.ok(shell.error());

var result = shell.test('f', 'resources/file1'); // bad expression
assert.ok(shell.error());

var result = shell.test('-f'); // no file
assert.ok(shell.error());

//
// Valids
//

//exists
var result = shell.test('-e', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, true);

//directory
var result = shell.test('-d', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

var result = shell.test('-f', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-L', 'resources');
assert.equal(shell.error(), null);
assert.equal(result, false);

//file
var result = shell.test('-d', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-f', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

var result = shell.test('-L', 'resources/file1');
assert.equal(shell.error(), null);
assert.equal(result, false);

//link
var result = shell.test('-d', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-f', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, false);

var result = shell.test('-L', 'resources/link');
assert.equal(shell.error(), null);
assert.equal(result, true);//true

shell.exit(123);
{'fraction_non_alphanumeric': 0.21844802342606148, 'fraction_numerical': 0.0033674963396778915, 'mean_word_length': 5.354418604651163, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5059629', 'n_tokens_mistral': 2243, 'n_tokens_neox': 2236, 'n_words': 492}