<commit_before>import test from 'ava'
import {
  glob,
  sync,
  hasMagic
} from '../src'

import vanilla from 'glob'
import ignore from 'ignore'

import path from 'path'

const fixture = (filepath = '') => path.join(__dirname, 'fixtures', filepath)

const CASES = [
{
  d: 'basic',
  p: '**/*.js',
  i: 'a.js',
  r: ['b.js', 'a/b.js', 'a/a/b.js', 'a/a/a/b.js']
},
{
  d: 'patterns',
  p: ['*.js', 'a/*.js'],
  i: ['b.js'],
  r: ['a.js', 'a/a.js']
},
{
  d: 'patterns with negatives',
  p: ['*.js', 'a/**/*.js', '!a/a/a/*.js', '!a/a/*.js'],
  i: ['b.js'],
  r: ['a.js', 'a/a.js']
},
{
  d: 'without ignore',
  p: ['**/a.js'],
  r: ['a.js', 'a/a.js', 'a/a/a.js', 'a/a/a/a.js']
}
]

process.chdir(fixture())

const RUNNER = {
  glob (patterns, i) {
    return glob(patterns, {ignore: i})
  },

  sync (patterns, i) {
    try {
      return Promise.resolve(sync(patterns, {ignore: i}))
    } catch (e) {
      return Promise.reject(e)<commit_msg>adds test cases if there is only negative patterns<commit_after>import test from 'ava'
import {
  glob,
  sync,
  hasMagic
} from '../src'

import vanilla from 'glob'
import ignore from 'ignore'

import path from 'path'

const fixture = (filepath = '') => path.join(__dirname, 'fixtures', filepath)

const CASES = [
{
  d: 'basic',
  p: '**/*.js',
  i: 'a.js',
  r: ['b.js', 'a/b.js', 'a/a/b.js', 'a/a/a/b.js']
},
{
  d: 'patterns',
  p: ['*.js', 'a/*.js'],
  i: ['b.js'],
  r: ['a.js', 'a/a.js']
},
{
  d: 'patterns with negatives',
  p: ['*.js', 'a/**/*.js', '!a/a/a/*.js', '!a/a/*.js'],
  i: ['b.js'],
  r: ['a.js', 'a/a.js']
},
{
  d: 'without ignore',
  p: ['**/a.js'],
  r: ['a.js', 'a/a.js', 'a/a/a.js', 'a/a/a/a.js']
},
{
  d: 'only negative',
  p: ['!**/a.js'],
  r: []
}
]

process.chdir(fixture())

const RUNNER = {
  glob (patterns, i) {
    return glob(patterns, {ignore: i})
  },

  sync (patterns, i) {
    try {
      return Promise.resolve(sync(patterns, {ignore: i}))
    } catch (e) {
      return Promise.reject(e)
{'fraction_non_alphanumeric': 0.2746585735963581, 'fraction_numerical': 0.0, 'mean_word_length': 2.789272030651341, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2449934', 'n_tokens_mistral': 912, 'n_tokens_neox': 903, 'n_words': 207}