<commit_before>function toThrowError(fn) {
    console.assert( (function() {
        try {
            fn();
            return false;
        }
        catch (e) {
            return true;
        }
    })() )
}


var FTND = require('./index.js');


// getQuestions
console.assert(FTND.getQuestions().length === 6);

// getChoices
console.assert(FTND.getChoices(0).length === 4);
console.assert(FTND.getChoices(1).length === 2);
console.assert(FTND.getChoices(2).length === 2);
console.assert(FTND.getChoices(3).length === 4);
console.assert(FTND.getChoices(4).length === 2);
console.assert(FTND.getChoices(5).length === 2);


// calculate
console.assert(FTND.calculate([0,0,0,0,0,0]) === 7);
console.assert(FTND.calculate([3,0,0,0,0,0]) === 4);
console.assert(FTND.calculate([2,1,0,3,1,0]) === 6);
console.assert(FTND.calculate([0,0,0,3,0,0]) === 10);
console.assert(FTND.calculate(['0','0','0','3','0','0']) === 10);

toThrowError(function() { FTND.calculate([0,0,0,3,0]) }); // 長さのエラーを出す
toThrowError(function() { FTND.calculate([0,0,0,0,0,4]) }); // 値のエラーを出す

console.log('すべてのテスト通過');
<commit_msg>update test<commit_after>function toThrowError(fn) {
    console.assert( (function() {
        try {
            fn();
            return false;
        }
        catch (e) {
            return true;
        }
    })() )
}


var FTCQ = require('./index.js');


// getQuestions
console.assert(FTCQ.getQuestions().length === 12);

// getChoices
// console.assert(FTCQ.getChoices(0).length === 7);


// calculate
console.assert(FTCQ.calculate([2,1,4,2,1,4,2,1,4,2,1,4]) === 2.33);
// calculateFactors
console.assert(FTCQ.calculateFactors([2,1,4,2,1,4,2,1,4,2,1,4])[1] === 3.5);

toThrowError(function() { FTCQ.calculateFactors([0,0,0,3,0]) }); // 長さのエラーを出す

console.log('すべてのテスト通過');

{'fraction_non_alphanumeric': 0.22701793721973093, 'fraction_numerical': 0.05605381165919283, 'mean_word_length': 3.660574412532637, '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': '3880567', 'n_tokens_mistral': 753, 'n_tokens_neox': 714, 'n_words': 81}