<commit_before>var demand = require('must'),
	NumberArrayType = require('../NumberArrayType');

exports.initList = function(List) {
	List.add({
		numarr: { type: NumberArrayType },
		nested: {
			numarr: { type: NumberArrayType }
		}
	});
};

exports.testFieldType = function(List) {
	var testItem = new List.model();
	
	it('should default to an empty array', function() {
		demand(testItem.get('numarr')).eql([]);
	});
	
	it('should validate input', function() {
		demand(List.fields.numarr.validateInput({
			numarr: [1]
		})).be(true);
		demand(List.fields.numarr.validateInput({
			numarr: [1, 2]
		})).be(true);
	});
	
	it('should validate no input', function() {
		demand(List.fields.numarr.validateInput({})).be(true);
		demand(List.fields.numarr.validateInput({}, true)).be(false);
		testItem.numarr = [1];
		demand(List.fields.numarr.validateInput({}, true, testItem)).be(true);
		testItem.numarr = undefined;
	});
	
	it('should validate length when required', function() {
		demand(List.fields.numarr.validateInput({
			numarr: []
		}, true)).be(false);
	});
	
	it('should validate arrays with string values', function() {
		demand(List.fields.numarr.validateInput({
			numarr: ['1']
		})).be(true);
	});
	
	it('should invalidate arrays with non-numeric string values', function() {
		demand(List.fields.numarr.validateInput({
			numarr: ['a']
		})).be(false);
	});
	<commit_msg>modified description for clarity<commit_after>var demand = require('must'),
	NumberArrayType = require('../NumberArrayType');

exports.initList = function(List) {
	List.add({
		numarr: { type: NumberArrayType },
		nested: {
			numarr: { type: NumberArrayType }
		}
	});
};

exports.testFieldType = function(List) {
	var testItem = new List.model();
	
	it('should default to an empty array', function() {
		demand(testItem.get('numarr')).eql([]);
	});
	
	it('should validate input', function() {
		demand(List.fields.numarr.validateInput({
			numarr: [1]
		})).be(true);
		demand(List.fields.numarr.validateInput({
			numarr: [1, 2]
		})).be(true);
	});
	
	it('should validate no input', function() {
		demand(List.fields.numarr.validateInput({})).be(true);
		demand(List.fields.numarr.validateInput({}, true)).be(false);
		testItem.numarr = [1];
		demand(List.fields.numarr.validateInput({}, true, testItem)).be(true);
		testItem.numarr = undefined;
	});
	
	it('should validate length when required', function() {
		demand(List.fields.numarr.validateInput({
			numarr: []
		}, true)).be(false);
	});
	
	it('should validate arrays with numeric string values', function() {
		demand(List.fields.numarr.validateInput({
			numarr: ['1']
		})).be(true);
	});
	
	it('should invalidate arrays with non-numeric string values', function() {
		demand(List.fields.numarr.validateInput({
			numarr: ['a']
		})).be(false);
	});
	
{'fraction_non_alphanumeric': 0.1875222816399287, 'fraction_numerical': 0.0035650623885918, 'mean_word_length': 4.534516765285996, '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': '3298378', 'n_tokens_mistral': 1036, 'n_tokens_neox': 929, 'n_words': 182}