<commit_before>import {expect} from 'chai'
import checkCourseAgainstQuery from '../../src/helpers/check-course-against-query'

describe('checkCourseAgainstQuery', () => {
	it('compares a course to a query object', () => {
		let query = {depts: ['AMCON'], year: [2013]}
		let course = {depts: ['AMCON'], year: 2013}
		expect(checkCourseAgainstQuery(query, course)).to.be.true
	})

	it('properly handles a list of five years', () => {
		let query = {year: ['$OR', 2010, 2011, 2012, 2013, 2014]}
		let course = {depts: ['ASIAN'], year: 2012}
		expect(checkCourseAgainstQuery(query, course)).to.be.true
	})

	it('handles complicated queries', () => {
		let query = {
			depts: ['$AND', 'ASIAN', 'REL'],
			title: ['Japan'],
			level: [200],
			year: [2014],
			semester: ['$OR', 3, 1],
		}
		let course = {
			depts: ['ASIAN', 'REL'],
			year: 2014,
			semester: 1,
			level: 200,
			title: 'Japan',
		}
		expect(checkCourseAgainstQuery(query, course)).to.be.true
	})

	it('handles complicated queries', () => {
		let query = {
			depts: ['$AND', 'ASIAN', 'REL'],
			title: ['Japan'],
			level: [200],
			year: [2014],
			semester: ['$OR', 3, 1],
		}
		let course = {
			depts: ['ASIAN'],
		}
		expect(checkCourseAgainstQuery(query, course)).to.be.false
	})

	it('handles $NOT queries', () => {
		let query = {
			profWords: ['macpherson'],
			deptnum: ['$NOT', 'ASIAN 275'],
		}
		let course = {
			deptnum: 'ASIAN 215',
			profWords: ['kristina', 'macpherson', 'karil', 'kucera'],
		}

		expect(checkCourseAgainstQuery(query, course)).to.be.true
	})
})<commit_msg>update the checkCourseAgainstQuery test<commit_after>import {expect} from 'chai'
import checkCourseAgainstQuery from '../../src/helpers/check-course-against-query'

describe('checkCourseAgainstQuery', () => {
	it('compares a course to a query object', () => {
		let query = {depts: ['AMCON'], year: [2013]}
		let course = {depts: ['AMCON'], year: 2013}
		expect(checkCourseAgainstQuery(query)(course)).to.be.true
	})

	it('properly handles a list of five years', () => {
		let query = {year: ['$OR', 2010, 2011, 2012, 2013, 2014]}
		let course = {depts: ['ASIAN'], year: 2012}
		expect(checkCourseAgainstQuery(query)(course)).to.be.true
	})

	it('handles complicated queries', () => {
		let query = {
			depts: ['$AND', 'ASIAN', 'REL'],
			title: ['Japan'],
			level: [200],
			year: [2014],
			semester: ['$OR', 3, 1],
		}
		let course = {
			depts: ['ASIAN', 'REL'],
			year: 2014,
			semester: 1,
			level: 200,
			title: 'Japan',
		}
		expect(checkCourseAgainstQuery(query)(course)).to.be.true
	})

	it('handles complicated queries', () => {
		let query = {
			depts: ['$AND', 'ASIAN', 'REL'],
			title: ['Japan'],
			level: [200],
			year: [2014],
			semester: ['$OR', 3, 1],
		}
		let course = {
			depts: ['ASIAN'],
		}
		expect(checkCourseAgainstQuery(query)(course)).to.be.false
	})

	it('handles $NOT queries', () => {
		let query = {
			profWords: ['macpherson'],
			deptnum: ['$NOT', 'ASIAN 275'],
		}
		let course = {
			deptnum: 'ASIAN 215',
			profWords: ['kristina', 'macpherson', 'karil', 'kucera'],
		}

		expect(checkCourseAgainstQuery(query)(course)).to.be.true
	})
})
{'fraction_non_alphanumeric': 0.20666666666666667, 'fraction_numerical': 0.040634920634920635, 'mean_word_length': 3.8551617873651773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3825853', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1145, 'n_words': 270}