<commit_before>// Load modules

var Lab = require('lab');
var Hapi = require('..');
var Package = require('../package.json');


// Declare internals

var internals = {};


// Test shortcuts

var expect = Lab.expect;
var before = Lab.before;
var after = Lab.after;
var describe = Lab.experiment;
var it = Lab.test;


describe('Utils', function () {

    describe('#version', function () {

        it('returns the correct package version number', function (done) {

            expect(Hapi.utils.version()).to.equal(Package.version);
            done();
        });
    });
});<commit_msg>Added tests for checking isAbsolutePath<commit_after>// Load modules

var Lab = require('lab');
var Hapi = require('..');
var Package = require('../package.json');


// Declare internals

var internals = {};


// Test shortcuts

var expect = Lab.expect;
var before = Lab.before;
var after = Lab.after;
var describe = Lab.experiment;
var it = Lab.test;


describe('Utils', function () {

    describe('#version', function () {

        it('returns the correct package version number', function (done) {

            expect(Hapi.utils.version()).to.equal(Package.version);
            done();
        });
    });

    describe('#isAbsolutePath', function () {

        it('returns true for absolute *nix path', function (done) {
            var path = '/test/directory/file.js';
            expect(Hapi.utils.isAbsolutePath(path)).to.equal(true);
            done();
        });

        it('returns true for absolute Windows path', function (done) {
            var path = 'C:\\Test\\Directory\\File.txt';
            expect(Hapi.utils.isAbsolutePath(path)).to.equal(true);
            done();
        });

        it('returns true for absolute azure path', function (done) {
            var path = '\\\\server\\test\\directory\\file.js';
            expect(Hapi.utils.isAbsolutePath(path)).to.equal(true);
            done();
        });

        it('returns false for *nix relative path', function (done) {
            var path = '../test/directory/test.js';
            expect(Hapi.utils.isAbsolutePath(path)).to.equal(false);
            done();
        });

        it('returns false for windows relative path', function (done) {
            var path = '..\\test\\directory\\test.js';
            expect(Hapi.utils.isAbsolutePath(path)).to.equal(false);
            done();
        })
    });
});
{'fraction_non_alphanumeric': 0.16164154103852596, 'fraction_numerical': 0.0, 'mean_word_length': 2.331938633193863, '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': '565730', 'n_tokens_mistral': 681, 'n_tokens_neox': 655, 'n_words': 165}