<commit_before>var path = require('path');
var versioning = require('../lib/util/versioning.js');
var assert = require('assert');

describe('versioning', function() {
    it('should normalize double slash', function() {
        var mock_package_json = {
            "name"   : "test",
            "main"   : "test.js",
            "version": "0.1.0",
            "binary" : {
                "module_name" : "test",
                "module_path" : "./lib/binding/{configuration}/{toolset}/{name}",
                "remote_path" : "./{name}/v{version}/{configuration}/{version}/{toolset}/",
                "package_name": "{module_name}-v{major}.{minor}.{patch}-{prerelease}+{build}-{toolset}-{node_abi}-{platform}-{arch}.tar.gz",
                "host"        : "https://node-pre-gyp-tests.s3-us-west-1.amazonaws.com"                
            }
        }
        var opts = versioning.evaluate(mock_package_json, {});
        assert.equal(opts.remote_path,"./test/v0.1.0/Release/0.1.0/");
        assert.equal(opts.module_path,path.join(process.cwd(),"lib/binding/Release/test"));
        var opts_toolset = versioning.evaluate(mock_package_json, {toolset:"custom-toolset"});
        assert.equal(opts_toolset.remote_path,"./test/v0.1.0/Release/0.1.0/custom-toolset/");
    });

    it('should detect abi for node process', function() {
        var mock_process_versions = {
            node: '0.10.33',
            v8: '3.14.5.9',
            modules: '11',
        }
        var abi = versioning.get_node_abi_for_process('node',mock_process_versions);
        assert.equal(abi,'node-v11');
        assert.equal(versioning.get_runtime_abi('node',undefined),versioning.get_node_abi_for_process('node',process.versions));
    });
<commit_msg>fix node v0.11.x tests on windows - refs joyent/node#7031<commit_after>var path = require('path');
var versioning = require('../lib/util/versioning.js');
var assert = require('assert');

describe('versioning', function() {
    it('should normalize double slash', function() {
        var mock_package_json = {
            "name"   : "test",
            "main"   : "test.js",
            "version": "0.1.0",
            "binary" : {
                "module_name" : "test",
                "module_path" : "./lib/binding/{configuration}/{toolset}/{name}",
                "remote_path" : "./{name}/v{version}/{configuration}/{version}/{toolset}/",
                "package_name": "{module_name}-v{major}.{minor}.{patch}-{prerelease}+{build}-{toolset}-{node_abi}-{platform}-{arch}.tar.gz",
                "host"        : "https://node-pre-gyp-tests.s3-us-west-1.amazonaws.com"                
            }
        }
        var opts = versioning.evaluate(mock_package_json, {});
        assert.equal(opts.remote_path,"./test/v0.1.0/Release/0.1.0/");
        // Node v0.11.x on windows lowercases C:// when path.join is called
        // https://github.com/joyent/node/issues/7031
        assert.equal(path.normalize(opts.module_path),path.join(process.cwd(),"lib/binding/Release/test"));
        var opts_toolset = versioning.evaluate(mock_package_json, {toolset:"custom-toolset"});
        assert.equal(opts_toolset.remote_path,"./test/v0.1.0/Release/0.1.0/custom-toolset/");
    });

    it('should detect abi for node process', function() {
        var mock_process_versions = {
            node: '0.10.33',
            v8: '3.14.5.9',
            modules: '11',
        }
        var abi = versioning.get_node_abi_for_process('node',mock_process_versions);
        assert.equal(abi,'node-v11');
        assert.equal(versioning.get_runtime_abi('node',undefined),versioning.get_node_abi_for_process('node',process.versions));
    });

{'fraction_non_alphanumeric': 0.17771739130434783, 'fraction_numerical': 0.021195652173913043, 'mean_word_length': 2.4759206798866855, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2064552', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1169, 'n_words': 148}