<commit_before>progeny = require '..'
path = require 'path'
assert = require 'assert'

getFixturePath = (subPath) ->
	path.join __dirname, 'fixtures', subPath

describe 'progeny', ->
	it 'should preserve original file extensions', (done) ->
		progeny() getFixturePath('altExtensions.jade'), (err, dependencies) ->
			paths = (getFixturePath x for x in ['htmlPartial.html', 'htmlPartial.html.jade'])
			assert.deepEqual dependencies, paths
			do done

	it 'should resolve multiline @import statements', (done) ->
		progeny() getFixturePath('multilineImport.scss'), (err, dependencies) ->
			# 6 non-excluded references in fixture
			# x4 for prefixed/unprefixed and both file extensions
			assert.equal dependencies.length, 24
			do done

	it 'should be truly async', (done) ->
		dependencies = null
		progeny() getFixturePath('altExtensions.jade'), (err, deps) ->
			dependencies = deps
			assert Array.isArray dependencies
			do done
		assert.equal dependencies, null

describe 'progeny.Sync', ->
	it 'should return the result', ->
		assert Array.isArray progeny.Sync() getFixturePath('altExtensions.jade')

describe 'progeny configuration', ->
	describe 'excluded file list', ->
		progenyConfig =
			rootPath: path.join __dirname, 'fixtures'
			exclusion: [
				/excludedDependencyOne/
				/excludedDependencyTwo/
			]
			extension: 'jade'

		it 'should accept one regex', (done) ->
			progenyConfig.exclusion = /excludedDependencyOne/
			getDependencies = progeny progenyConfig

			getDependencies getFixturePath('excludedDependencies.jade'), (err, dependencies) ->
				paths =  (getFixturePath x for x in ['excludedDependencyTwo.jade', 'includedDependencyOne.jade'])
				assert.deepEqual dependencies, paths
				do done
<commit_msg>Add failing test for unmatched multipass<commit_after>progeny = require '..'
path = require 'path'
assert = require 'assert'

getFixturePath = (subPath) ->
	path.join __dirname, 'fixtures', subPath

describe 'progeny', ->
	it 'should preserve original file extensions', (done) ->
		progeny() getFixturePath('altExtensions.jade'), (err, dependencies) ->
			paths = (getFixturePath x for x in ['htmlPartial.html', 'htmlPartial.html.jade'])
			assert.deepEqual dependencies, paths
			do done

	it 'should resolve multiline @import statements', (done) ->
		progeny() getFixturePath('multilineImport.scss'), (err, dependencies) ->
			# 6 non-excluded references in fixture
			# x4 for prefixed/unprefixed and both file extensions
			assert.equal dependencies.length, 24
			do done

	it 'should be truly async', (done) ->
		dependencies = null
		progeny() getFixturePath('altExtensions.jade'), (err, deps) ->
			dependencies = deps
			assert Array.isArray dependencies
			do done
		assert.equal dependencies, null

	it 'should return empty array when there are no deps', (done) ->
		progeny() 'foo.scss', '$a: 5px; .test {\n  border-radius: $a; }\n', (err, deps) ->
			assert.deepEqual deps, []
			do done

describe 'progeny.Sync', ->
	it 'should return the result', ->
		assert Array.isArray progeny.Sync() getFixturePath('altExtensions.jade')

describe 'progeny configuration', ->
	describe 'excluded file list', ->
		progenyConfig =
			rootPath: path.join __dirname, 'fixtures'
			exclusion: [
				/excludedDependencyOne/
				/excludedDependencyTwo/
			]
			extension: 'jade'

		it 'should accept one regex', (done) ->
			progenyConfig.exclusion = /excludedDependencyOne/
			getDependencies = progeny progenyConfig

			getDependencies getFixturePath('excludedDependencies.jade'), (err, dependencies) ->
				paths =  (getFixturePath x for x in ['excludedDependencyTwo.jade', 'includedDependencyOne.jade'])
				assert.deepEqual dependencies, paths
				do done

{'fraction_non_alphanumeric': 0.11839609861826063, 'fraction_numerical': 0.002438363587103766, 'mean_word_length': 4.2592592592592595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '5239920', 'n_tokens_mistral': 1276, 'n_tokens_neox': 1108, 'n_words': 323}