<commit_before>import test from 'ava';
import {parse} from '..';

const testCases = [
  ['single word query',
    'simple',
    [['INCLUDING', 'simple']]
  ]
];

testCases.forEach(([name, query, expected]) => {
  test(name, t => {
    t.deepEqual(
      parse(query),
      expected
    );
  });
});<commit_msg>triple or and insanity test<commit_after>import test from 'ava';
import {parse} from '..';

const testCases = [
  [
    'single word query',
    'simple',
    [['INCLUDING', 'simple']]
  ],
  [
    'triple OR',
    'a OR b OR x',
    [
      [
        'OR',
        [
          ['INCLUDING', 'a'],
          ['INCLUDING', 'b'],
          ['INCLUDING', 'c']
        ]
      ]
    ]
  ],
  [
    'extreme example',
    `search #search @search -query filter:vine exclude:retweets exclude:nativeretweets
     min_replies:10 OR min_rts:100 min_faves:20 lang:es OR to:jack
     since:2016-01-01 until:2016-02-01 list:NASA/astronauts-in-space-now filter:verified
     cats OR dogs OR beavers`,
    [
      ['INCLUDING', 'search'],
      ['INCLUDING', '#search'],
      ['INCLUDING', '@search'],
      ['EXCLUDING', 'query'],
      ['FILTER', 'vine'],
      ['EXCLUDE', 'retweets'],
      ['EXCLUDE', 'nativeretweets'],
      ['OR', [['MIN_REPLIES', '10'], ['INCLUDING', 'min_rts:100']]],
      ['MIN_FAVES', '20'],
      ['OR', [['LANG', 'es'], ['TO', 'jack']]],
      ['SINCE', '2016-01-01'],
      ['UNTIL', '2016-02-01'],
      ['LIST', 'NASA', 'astronauts-in-space-now'],
      ['FILTER', 'verified'],
      [
        'OR',
        [
          ['INCLUDING', 'cats'],
          ['INCLUDING', 'dogs'],
          ['INCLUDING', 'beavers']
        ]
      ]
    ]
  ]
];

testCases.forEach(([name, query, expected]) => {
  test(name, t => {
    t.deepEqual(
      parse(query),
      expected
    );
  });
});
{'fraction_non_alphanumeric': 0.2130242825607064, 'fraction_numerical': 0.025386313465783666, 'mean_word_length': 2.3205128205128207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5487672', 'n_tokens_mistral': 673, 'n_tokens_neox': 635, 'n_words': 131}