<commit_before>(function() {
    'use strict';
    
    var DIR                 = process.cwd() + '/',
        main                = require(DIR + 'lib/server/main'),
        
        Util                = main.util,
        
        CloudFunc           = main.cloudfunc,
        HTMLDIR             = main.HTMLDIR,
        files               = main.files,
        
        TEMPLATEPATH        = HTMLDIR + 'file.html',
        LINK_TEMPLATE_PATH  = HTMLDIR + 'link.html',
        PATHTEMPLATE_PATH   = HTMLDIR + 'path.html',
        EXPECT_PATH         = DIR + 'test/expect.html',
        
        Files               = [TEMPLATEPATH, PATHTEMPLATE_PATH, LINK_TEMPLATE_PATH, EXPECT_PATH],
        
        JSON_FILES          = {
            path  : "/etc/X11/", 
            files : [{
                name: "applnk",
                size: "dir",
                uid : 0,
                mode: "40755"
            }, {
                name: "prefdm",
                size: 1328,
                uid : 0,
                mode: "100755"
            }]
        },
        
        
        Expect =
            '<div id="js-path" class="reduce-text" title="/etc/X11/">'           +
                '<span class="path-icon clear-storage" '                        +
                    'title="clear storage (Ctrl+D)">'                           +
                '</span>'                                                       +
                '<span class="path-icon refresh-icon" title="refresh (Ctrl+R)">'+
                    '<a href="/fs/etc/X11"></a></span>'                         +
                '<span class=links>'                                            +
                    '<a href="/fs" title="/">/</a>'                             +
                    '<a href="/fs/etc" title="/etc">'                           +
                        'etc'                                                   +
                    '</a>/X11/'                                                 +
                '</span>'                                                       +
            '</li>'                                                             +
            '<li class=fm-header>'                                              +
                '<span class=mini-icon></span>'                                 +
                '<span class=name>"name reduce-text"</span>'                    +
                '<span class=size>"size reduce-text"</span>'                    +
                '<span class=owner>"owner reduce-text"</span>'                  +
                '<span class=mode>"mode reduce-text"</span>'                    +
            '</li>';
    
    
    files.read(Files, 'utf-8', function(errors, files) {
        var i, n, template, pathTemplate, linkTemplate, expect, result;
        
        if (errors)
            Util.log(errors);
        else {
            Util.time('CloudFunc.buildFromJSON');
            
            template        = files[TEMPLATEPATH];
            pathTemplate    = files[PATHTEMPLATE_PATH];
            linkTemplate    = files[LINK_TEMPLATE_PATH];
            expect          = files[EXPECT_PATH];
            
            result          = CloudFunc.buildFromJSON(JSON_FILES, template, pathTemplate, linkTemplate);
            
            Expect          += expect;<commit_msg>fix(test) li -> div<commit_after>(function() {
    'use strict';
    
    var DIR                 = process.cwd() + '/',
        main                = require(DIR + 'lib/server/main'),
        
        Util                = main.util,
        
        CloudFunc           = main.cloudfunc,
        HTMLDIR             = main.HTMLDIR,
        files               = main.files,
        
        TEMPLATEPATH        = HTMLDIR + 'file.html',
        LINK_TEMPLATE_PATH  = HTMLDIR + 'link.html',
        PATHTEMPLATE_PATH   = HTMLDIR + 'path.html',
        EXPECT_PATH         = DIR + 'test/expect.html',
        
        Files               = [TEMPLATEPATH, PATHTEMPLATE_PATH, LINK_TEMPLATE_PATH, EXPECT_PATH],
        
        JSON_FILES          = {
            path  : "/etc/X11/", 
            files : [{
                name: "applnk",
                size: "dir",
                uid : 0,
                mode: "40755"
            }, {
                name: "prefdm",
                size: 1328,
                uid : 0,
                mode: "100755"
            }]
        },
        
        
        Expect =
            '<div id="js-path" class="reduce-text" title="/etc/X11/">'          +
                '<span class="path-icon clear-storage" '                        +
                    'title="clear storage (Ctrl+D)">'                           +
                '</span>'                                                       +
                '<span class="path-icon refresh-icon" title="refresh (Ctrl+R)">'+
                    '<a href="/fs/etc/X11"></a></span>'                         +
                '<span class=links>'                                            +
                    '<a href="/fs" title="/">/</a>'                             +
                    '<a href="/fs/etc" title="/etc">'                           +
                        'etc'                                                   +
                    '</a>/X11/'                                                 +
                '</span>'                                                       +
            '</div>'                                                            +
            '<div class=fm-header>'                                             +
                '<span class=mini-icon></span>'                                 +
                '<span class=name>"name reduce-text"</span>'                    +
                '<span class=size>"size reduce-text"</span>'                    +
                '<span class=owner>"owner reduce-text"</span>'                  +
                '<span class=mode>"mode reduce-text"</span>'                    +
            '</div>';
    
    
    files.read(Files, 'utf-8', function(errors, files) {
        var i, n, template, pathTemplate, linkTemplate, expect, result;
        
        if (errors)
            Util.log(errors);
        else {
            Util.time('CloudFunc.buildFromJSON');
            
            template        = files[TEMPLATEPATH];
            pathTemplate    = files[PATHTEMPLATE_PATH];
            linkTemplate    = files[LINK_TEMPLATE_PATH];
            expect          = files[EXPECT_PATH];
            
            result          = CloudFunc.buildFromJSON(JSON_FILES, template, pathTemplate, linkTemplate);
            
            Expect          += expect;
{'fraction_non_alphanumeric': 0.11489107729036109, 'fraction_numerical': 0.007758877946881528, 'mean_word_length': 0.7779840848806366, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1719593', 'n_tokens_mistral': 1629, 'n_tokens_neox': 1537, 'n_words': 269}