<commit_before>// Import and configure assertion framework
var chai = require('chai');
chai.use(require('chai-datetime'));
var assert = chai.assert;

// Import the library to test.
var IntervalRecurrence = require('../dist/');

// Describe tests.
describe('iso8601-interval-recurrence', function () {

	it('should be able to check a date against a start date and interval', function () {
		// Matches every Wednesday
		var every_wednesday = new IntervalRecurrence({
			interval: '2015-07-22T00:00:00.000Z/P1D',
			recurrence: 'R/P1W'
		});

		var wednesday = '2015-07-29T13:00:00.000Z';
		var tuesday = '2015-07-23T11:12:13.000Z';

		assert.equal(every_wednesday.containsDate(wednesday), true);
		assert.equal(every_wednesday.containsDate(tuesday),   false);
	});

	it('should be able to check a date against an interval and end date', function () {
		// Matches every wednesday
		var every_wednesday = new IntervalRecurrence({
			interval: 'P1D/2015-07-23T00:00:00.000Z',
			recurrence: 'R/P1W'
		});

		var wednesday = '2015-07-29T13:00:00.000Z';
		var tuesday = '2015-07-23T11:12:13.000Z';

		assert.equal(every_wednesday.containsDate(wednesday), true);
		assert.equal(every_wednesday.containsDate(tuesday),   false);
	});

	it('should be able to check only a specific limit of recurrences', function () {
		// Matches every Wednesday for two weeks
		var every_wednesday_for_two_weeks = new IntervalRecurrence({
			interval: '2015-07-22T00:00:00.000Z/P1D',
			recurrence: 'R2/P1W'<commit_msg>Changed wednesday tests to be more generic.<commit_after>// Import and configure assertion framework
var chai = require('chai');
chai.use(require('chai-datetime'));
var assert = chai.assert;

// Import the library to test.
var IntervalRecurrence = require('../dist/');

// Describe tests.
describe('iso8601-interval-recurrence', function () {

	it('should be able to check a date against a start date and interval', function () {
		// Matches every Wednesday
		var every_wednesday = new IntervalRecurrence({
			interval: '2015-W01-3T/P1D',
			recurrence: 'R/P1W'
		});

		var wednesday = '2015-07-29T13:00:00.000Z';
		var tuesday = '2015-07-23T11:12:13.000Z';

		assert.equal(every_wednesday.containsDate(wednesday), true);
		assert.equal(every_wednesday.containsDate(tuesday),   false);
	});

	it('should be able to check a date against an interval and end date', function () {
		// Matches every wednesday
		var every_wednesday = new IntervalRecurrence({
			interval: 'P1D/2015-W01-4T',
			recurrence: 'R/P1W'
		});

		var wednesday = '2015-07-29T13:00:00.000Z';
		var tuesday = '2015-07-23T11:12:13.000Z';

		assert.equal(every_wednesday.containsDate(wednesday), true);
		assert.equal(every_wednesday.containsDate(tuesday),   false);
	});

	it('should be able to check only a specific limit of recurrences', function () {
		// Matches every Wednesday for two weeks
		var every_wednesday_for_two_weeks = new IntervalRecurrence({
			interval: '2015-07-22T00:00:00.000Z/P1D',
			recurrence: 'R2/P1W'
{'fraction_non_alphanumeric': 0.13593854375417502, 'fraction_numerical': 0.08016032064128256, 'mean_word_length': 4.425724637681159, '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': '5848261', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1033, 'n_words': 247}