<commit_before>/**
 * relative <https://github.com/jonschlinkert/relative>
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var should = require('should');
var path = require('path');
var relative = require('./');
var cwd = process.cwd();

function normalize(str) {
  return str.replace(/[\\\/]+/g, '/');
}

describe('relative', function() {
  it('should resolve the relative path from a file to a file', function() {
    normalize(relative('test/fixtures/foo.txt', 'docs/new/file.txt')).should.equal('../../docs/new/file.txt');
    normalize(relative('test/fixtures/foo.txt', 'test/fixtures/bar.txt')).should.equal('./bar.txt');
  });

  it('should resolve the relative path from a file to a directory', function() {
    normalize(relative('test\\fixtures\\foo.txt', 'docs')).should.equal('../../docs');
    normalize(relative('test\\fixtures\\foo.txt', 'test/fixtures')).should.equal('./');
  });

  it('should resolve the relative path from a directory to a directory', function() {
    normalize(relative('test/fixtures', 'docs')).should.equal('../../docs');
    normalize(relative('test/foo', 'test/bar')).should.equal('../bar');
  });

  it('should resolve the relative path from a directory to a file', function() {
    normalize(relative('test/fixtures', 'docs/foo.txt')).should.equal('../../docs/foo.txt');
    normalize(relative('test/fixtures', 'test/foo.txt')).should.equal('../foo.txt');
  });

  it('should resolve the relative path to process.cwd()', function() {
    normalize(relative('test/fixtures/foo.txt', process.cwd())).should.equal('../..');
  });

  it('should resolve the relative path from process.cwd()', function() {
    normalize(relative(process.cwd(), 'test/fixtures/foo.txt')).should.equal('./test/fixtures/foo.txt');
  });
});


describe('normalize path', function() {
  it('should resolve the relative path from a file to a file', function() {<commit_msg>adding a failing tests for `.`<commit_after>/**
 * relative <https://github.com/jonschlinkert/relative>
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

'use strict';

var should = require('should');
var path = require('path');
var relative = require('./');
var cwd = process.cwd();

function normalize(str) {
  return str.replace(/[\\\/]+/g, '/');
}

describe('relative', function() {
  it('should resolve the relative path from a file to a file', function() {
    normalize(relative('test/fixtures/foo.txt', 'docs/new/file.txt')).should.equal('../../docs/new/file.txt');
    normalize(relative('test/fixtures/foo.txt', 'test/fixtures/bar.txt')).should.equal('./bar.txt');
  });

  it('should resolve the relative path from a file to a directory', function() {
    normalize(relative('test\\fixtures\\foo.txt', 'docs')).should.equal('../../docs');
    normalize(relative('test\\fixtures\\foo.txt', 'test/fixtures')).should.equal('./');
  });

  it('should resolve the relative path from a directory to a directory', function() {
    normalize(relative('test/fixtures', 'docs')).should.equal('../../docs');
    normalize(relative('test/foo', 'test/bar')).should.equal('../bar');
  });

  it('should resolve the relative path from a directory to a file', function() {
    normalize(relative('test/fixtures', 'docs/foo.txt')).should.equal('../../docs/foo.txt');
    normalize(relative('test/fixtures', 'test/foo.txt')).should.equal('../foo.txt');
    normalize(relative('test-with-dashes', 'test-with-dashes/fixtures/foo.txt')).should.eql('./fixtures/foo.txt');
    normalize(relative('test.with.dots', 'test.with.dots/fixtures/foo.txt')).should.eql('./fixtures/foo.txt');
  });

  it('should resolve the relative path to process.cwd()', function() {
    normalize(relative('test/fixtures/foo.txt', process.cwd())).should.equal('../..');
  });

  it('should resolve the relative path from process.cwd()', function() {
    normalize(relative(process.cwd(), 'test/fixtures/foo.txt')).should.equal('./test/fixtures/foo.txt');
  });
});


describe('normalize path', function() {
  it('should resolve the relative path from a file to a file', function() {
{'fraction_non_alphanumeric': 0.2163942424981703, 'fraction_numerical': 0.0019516955354964625, 'mean_word_length': 4.170239596469105, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6209967', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1267, 'n_words': 271}