<commit_before>"use strict";
/*global suite: false, test: false, setup: false*/

var assert = require('assert'),
    expector = require('../lib/expector'),
    cje = expector.test.checkJSONExpression;


suite('checkJSONExpresion', function() {
    test('$length', function(done) {
        assert(  cje({$length: 1}, [2]) );
        assert( !cje({$length: 1}, []) );
        assert( !cje({$length: 1}, [2, 3]) );
        assert(  cje({$length: 4}, [1, 2, 3, 4]) );

        done();
    });

    test('$unordered', function(done) {
        assert( cje({$unordered: [1, 2]}, [1, 2]) );
        assert( cje({$unordered: [1, 2]}, [2, 1]) );

        // FIXME: this seems like it should fail
        //assert(!cje({$unordered: [1, 2]}, [1, 2, 3]));

        assert( !cje({$unordered: [1, 2, 3]}, [1, 2]) );

        done();
    });

    test('comparisons', function(done) {
        assert(  cje({a: {$gt:  10}}, {a: 11}) );
        assert( !cje({a: {$gt:  10}}, {a: 10}) );
        assert( !cje({a: {$gt:  10}}, {a: 9})) ;

        assert(  cje({a: {$gte: 10}}, {a: 11}) );
        assert(  cje({a: {$gte: 10}}, {a: 10}) );
        assert( !cje({a: {$gte: 10}}, {a: 9})) ;

        assert( !cje({a: {$lt:  10}}, {a: 11}) );
        assert( !cje({a: {$lt:  10}}, {a: 10}) );
        assert(  cje({a: {$lt:  10}}, {a: 9})) ;

        assert( !cje({a: {$lte: 10}}, {a: 11}) );
        assert(  cje({a: {$lte: 10}}, {a: 10}) );
        assert(  cje({a: {$lte: 10}}, {a: 9})) ;
        done();
    });
});<commit_msg>fix whitespace to .jshintrc specifed 2<commit_after>"use strict";
/*global suite: false, test: false, setup: false*/

var assert = require('assert'),
    expector = require('../lib/expector'),
    cje = expector.test.checkJSONExpression;


suite('checkJSONExpresion', function() {
  test('$length', function(done) {
    assert(  cje({$length: 1}, [2]) );
    assert( !cje({$length: 1}, []) );
    assert( !cje({$length: 1}, [2, 3]) );
    assert(  cje({$length: 4}, [1, 2, 3, 4]) );

    done();
  });

  test('$unordered', function(done) {
    assert( cje({$unordered: [1, 2]}, [1, 2]) );
    assert( cje({$unordered: [1, 2]}, [2, 1]) );

    // FIXME: this seems like it should fail
    //assert(!cje({$unordered: [1, 2]}, [1, 2, 3]));

    assert( !cje({$unordered: [1, 2, 3]}, [1, 2]) );

    done();
  });

  test('comparisons', function(done) {
    assert(  cje({a: {$gt:  10}}, {a: 11}) );
    assert( !cje({a: {$gt:  10}}, {a: 10}) );
    assert( !cje({a: {$gt:  10}}, {a: 9})) ;

    assert(  cje({a: {$gte: 10}}, {a: 11}) );
    assert(  cje({a: {$gte: 10}}, {a: 10}) );
    assert( !cje({a: {$gte: 10}}, {a: 9})) ;

    assert( !cje({a: {$lt:  10}}, {a: 11}) );
    assert( !cje({a: {$lt:  10}}, {a: 10}) );
    assert(  cje({a: {$lt:  10}}, {a: 9})) ;

    assert( !cje({a: {$lte: 10}}, {a: 11}) );
    assert(  cje({a: {$lte: 10}}, {a: 10}) );
    assert(  cje({a: {$lte: 10}}, {a: 9})) ;
    done();
  });
});
{'fraction_non_alphanumeric': 0.2809832707408672, 'fraction_numerical': 0.0501877773984295, 'mean_word_length': 2.732484076433121, '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': '4515422', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1180, 'n_words': 305}