<commit_before>'use strict';

var gaze = require('../lib/gaze.js');
var grunt = require('grunt');
var path = require('path');
var helper = require('./helper');

var fixtures = path.resolve(__dirname, 'fixtures');
var sortobj = helper.sortobj;

function cleanUp(done) {
  [
    'newfolder',
  ].forEach(function(d) {
    var p = path.join(fixtures, d);
    if (grunt.file.exists(p)) {
      grunt.file.delete(p);
    }
  });
  done();
}

exports.matching = {
  setUp: function(done) {
    process.chdir(fixtures);
    cleanUp(done);
  },
  tearDown: cleanUp,
  globAll: function(test) {
    test.expect(2);
    gaze('**/*', function() {
      var result = this.relative(null, true);
      test.deepEqual(result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']);
      test.deepEqual(result['sub/'], ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  relativeDir: function(test) {
    test.expect(1);
    gaze('**/*', function() {
      test.deepEqual(this.relative('sub', true), ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  globArray: function(test) {
    test.expect(2);
    gaze(['*.js', 'sub/*.js'], function() {
      var result = this.relative(null, true);
      test.deepEqual(sortobj(result['.']), sortobj(['one.js', 'Project (LO)/', 'nested/', 'sub/']));
      test.deepEqual(sortobj(result['sub/']), sortobj(['one.js', 'two.js']));
      this.on('end', test.done);
      this.close();
    });
  },
  globArrayDot: function(test) {
    test.expect(1);
    gaze(['./sub/*.js'], function() {
      var result = this.relative(null, true);
      test.deepEqual(result['sub/'], ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();<commit_msg>Fix test, that pattern is actually not supposed to match those folders<commit_after>'use strict';

var gaze = require('../lib/gaze.js');
var grunt = require('grunt');
var path = require('path');
var helper = require('./helper');

var fixtures = path.resolve(__dirname, 'fixtures');
var sortobj = helper.sortobj;

function cleanUp(done) {
  [
    'newfolder',
  ].forEach(function(d) {
    var p = path.join(fixtures, d);
    if (grunt.file.exists(p)) {
      grunt.file.delete(p);
    }
  });
  done();
}

exports.matching = {
  setUp: function(done) {
    process.chdir(fixtures);
    cleanUp(done);
  },
  tearDown: cleanUp,
  globAll: function(test) {
    test.expect(2);
    gaze('**/*', function() {
      var result = this.relative(null, true);
      test.deepEqual(result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']);
      test.deepEqual(result['sub/'], ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  relativeDir: function(test) {
    test.expect(1);
    gaze('**/*', function() {
      test.deepEqual(this.relative('sub', true), ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  globArray: function(test) {
    test.expect(2);
    gaze(['*.js', 'sub/*.js'], function() {
      var result = this.relative(null, true);
      test.deepEqual(sortobj(result['.']), sortobj(['one.js', 'sub/']));
      test.deepEqual(sortobj(result['sub/']), sortobj(['one.js', 'two.js']));
      this.on('end', test.done);
      this.close();
    });
  },
  globArrayDot: function(test) {
    test.expect(1);
    gaze(['./sub/*.js'], function() {
      var result = this.relative(null, true);
      test.deepEqual(result['sub/'], ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
{'fraction_non_alphanumeric': 0.23116003386960204, 'fraction_numerical': 0.0022579734688117415, 'mean_word_length': 3.135355892648775, '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': '5793267', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1244, 'n_words': 227}