<commit_before>'use strict';

describe('smartRUtils', function() {
    var smartRUtils;

    beforeEach(function() {
        module('smartRApp');
    });

    beforeEach(inject(function(_smartRUtils_) {
        smartRUtils = _smartRUtils_;
    }));

    it('must be defined', function() {
        expect(smartRUtils).toBeDefined();
    });

    it('has functional conceptBoxMapToConceptKeys()', function() {
        var conceptBoxMap = {a: ['c1', 'c2'], 'foo bar __-!*()123 abc': ['c3'], b: [], c: ['12--_- c31/??/*&^/foobar']};
        var expected = {a_n0: 'c1', a_n1: 'c2', 'foo bar __-!*()123 abc_n0': 'c3', c_n0: '12--_- c31/??/*&^/foobar'};
        var result = smartRUtils.conceptBoxMapToConceptKeys(conceptBoxMap);
        expect(result).toEqual(expected);
    });
    
});
<commit_msg>some more tests<commit_after>'use strict';

describe('smartRUtils', function() {
    var smartRUtils;

    beforeEach(function() {
        module('smartRApp');
    });

    beforeEach(inject(function(_smartRUtils_) {
        smartRUtils = _smartRUtils_;
    }));

    it('must be defined', function() {
        expect(smartRUtils).toBeDefined();
    });

    it('has working conceptBoxMapToConceptKeys()', function() {
        var params = {a: ['c1', 'c2'], 'foo bar __-!*()123 abc': ['c3'], b: [], c: ['12--_- c31/??/*&^/foobar']};
        var expected = {a_n0: 'c1', a_n1: 'c2', 'foo bar __-!*()123 abc_n0': 'c3', c_n0: '12--_- c31/??/*&^/foobar'};
        var result = smartRUtils.conceptBoxMapToConceptKeys(params);
        expect(result).toEqual(expected);
    });

    it('has working makeSafeForCSS()', function() {
        var regex = /[_a-zA-Z]+[_a-zA-Z0-9-]*/;
        var testStr1 = '!@#$%^&*asdfghj _-;:,<.>/|\\"+=0987654321';
        var testStr2 = '__foo-bar-123';
        expect(testStr1.replace(regex, '')).not.toEqual('');
        expect(smartRUtils.makeSafeForCSS(testStr1).replace(regex, '')).toEqual('');
        expect(testStr2.replace(regex, '')).toEqual('');
        expect(smartRUtils.makeSafeForCSS(testStr2).replace(regex, '')).toEqual('');
    });

    it('has working shortenConcept()', function() {
        var testStr1 = '\\foo bar\\ab c d';
        var testStr2 = 'foo bar\\abcd';
        var testStr3 = '\\a\\b\\c\\d\\e\\f\\g\\h';
        var testStr4 = 'foo bar\\abcd\\';
        expect(smartRUtils.shortenConcept(testStr1)).toEqual('foo bar/ab c d');
        expect(smartRUtils.shortenConcept(testStr2)).toEqual('foo bar/abcd');
        expect(smartRUtils.shortenConcept(testStr3)).toEqual('g/h');
        expect(smartRUtils.shortenConcept(testStr4)).toEqual('foo bar/abcd');
    });
});

{'fraction_non_alphanumeric': 0.2098623853211009, 'fraction_numerical': 0.029434250764525993, 'mean_word_length': 3.121259842519685, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5100034', 'n_tokens_mistral': 961, 'n_tokens_neox': 930, 'n_words': 158}