<commit_before>var test = require("tap").test;
var rps = require("../index.js")
var path = require("path")

test("npa-basic", function (t) {
  t.setMaxListeners(999)

  var tests = {
    "foo@1.2": {
      name: "foo",
      type: "range",
      spec: ">=1.2.0 <1.3.0",
      raw: "foo@1.2",
      rawSpec: "1.2"
    },

    "@foo/bar": {
      raw: "@foo/bar",
      name: "@foo/bar",
      scope: "@foo",
      rawSpec: "",
      spec: "*",
      type: "range"
    },

    "@foo/bar@": {
      raw: "@foo/bar@",
      name: "@foo/bar",
      scope: "@foo",
      rawSpec: "",
      spec: "*",
      type: "range"
    },

    "@foo/bar@baz": {
      raw: "@foo/bar@baz",
      name: "@foo/bar",
      scope: "@foo",
      rawSpec: "baz",
      spec: "baz",
      type: "tag"
    },

    "@f fo o al/ a d s ;f ": {
      raw: "@f fo o al/ a d s ;f",
      name: null,
      rawSpec: "@f fo o al/ a d s ;f",
      spec: path.resolve("@f fo o al/ a d s ;f"),
      type: "local"
    },

    "foo@1.2.3": {
      name: "foo",
      type: "version",
      spec: "1.2.3",
      raw: "foo@1.2.3"
    },

    "foo@=v1.2.3": {
      name: "foo",
      type: "version",
      spec: "1.2.3",
      raw: "foo@=v1.2.3",
      rawSpec: "=v1.2.3"
    },

    "git+ssh://git@notgithub.com/user/foo#1.2.3": {
      name: null,
      type: "git",
      spec: "ssh://git@notgithub.com/user/foo#1.2.3",
      raw: "git+ssh://git@notgithub.com/user/foo#1.2.3"
    },

    "git+file://path/to/repo#1.2.3": {
      name: null,
      type: "git",
      spec: "file://path/to/repo#1.2.3",
      raw: "git+file://path/to/repo#1.2.3"
    },

    "git://notgithub.com/user/foo": {
      name: null,
      type: "git",
      spec: "git://notgithub.com/user/foo",
      raw: "git://notgithub.com/user/foo"
    },

    "@foo/bar@git+ssh://notgithub.com/user/foo": {
      name: "@foo/bar",
      scope: "@foo",
      spec: "ssh://notgithub.com/user/foo",
      rawSpec: "git+ssh://notgithub.com/user/foo",
      raw: "@foo/bar@git+ssh://notgithub.com/user/foo"
    },

    "/path/to/foo": {
      name: null,
      type: "local",
      spec: "/path/to/foo",
      raw: "/path/to/foo"
    },

    "file:path/to/foo": {
      name: null,
      type: "local",
      spec: path.resolve("path/to/foo"),
      raw: "file:path/to/foo"
    },

    "file:~/path/to/foo": {
      name: null,
      type: "local",
      spec: path.resolve("~/path/to/foo"),
      raw: "file:~/path/to/foo"
    },

    "file:../path/to/foo": {
      name: null,
      type: "local",
      spec: path.resolve("../path/to/foo"),
      raw: "file:../path/to/foo"
    },

    "file:///path/to/foo": {
      name: null,
      type: "local",
      spec: "/path/to/foo",
      raw: "file:///path/to/foo"
    },

    "https://server.com/foo.tgz": {
      name: null,
      type: "remote",
      spec: "https://server.com/foo.tgz",
      raw: "https://server.com/foo.tgz"
    },

    "foo@latest": {
      name: "foo",
      type: "tag",
      spec: "latest",
      raw: "foo@latest"<commit_msg>Fix path checks to work regardless of where the test is run from<commit_after>var test = require("tap").test;
var rps = require("../index.js")
var path = require("path")

test("npa-basic", function (t) {
  t.setMaxListeners(999)

  var tests = {
    "foo@1.2": {
      name: "foo",
      type: "range",
      spec: ">=1.2.0 <1.3.0",
      raw: "foo@1.2",
      rawSpec: "1.2"
    },

    "@foo/bar": {
      raw: "@foo/bar",
      name: "@foo/bar",
      scope: "@foo",
      rawSpec: "",
      spec: "*",
      type: "range"
    },

    "@foo/bar@": {
      raw: "@foo/bar@",
      name: "@foo/bar",
      scope: "@foo",
      rawSpec: "",
      spec: "*",
      type: "range"
    },

    "@foo/bar@baz": {
      raw: "@foo/bar@baz",
      name: "@foo/bar",
      scope: "@foo",
      rawSpec: "baz",
      spec: "baz",
      type: "tag"
    },

    "@f fo o al/ a d s ;f ": {
      raw: "@f fo o al/ a d s ;f",
      name: null,
      rawSpec: "@f fo o al/ a d s ;f",
      spec: path.resolve("@f fo o al/ a d s ;f"),
      type: "local"
    },

    "foo@1.2.3": {
      name: "foo",
      type: "version",
      spec: "1.2.3",
      raw: "foo@1.2.3"
    },

    "foo@=v1.2.3": {
      name: "foo",
      type: "version",
      spec: "1.2.3",
      raw: "foo@=v1.2.3",
      rawSpec: "=v1.2.3"
    },

    "git+ssh://git@notgithub.com/user/foo#1.2.3": {
      name: null,
      type: "git",
      spec: "ssh://git@notgithub.com/user/foo#1.2.3",
      raw: "git+ssh://git@notgithub.com/user/foo#1.2.3"
    },

    "git+file://path/to/repo#1.2.3": {
      name: null,
      type: "git",
      spec: "file://path/to/repo#1.2.3",
      raw: "git+file://path/to/repo#1.2.3"
    },

    "git://notgithub.com/user/foo": {
      name: null,
      type: "git",
      spec: "git://notgithub.com/user/foo",
      raw: "git://notgithub.com/user/foo"
    },

    "@foo/bar@git+ssh://notgithub.com/user/foo": {
      name: "@foo/bar",
      scope: "@foo",
      spec: "ssh://notgithub.com/user/foo",
      rawSpec: "git+ssh://notgithub.com/user/foo",
      raw: "@foo/bar@git+ssh://notgithub.com/user/foo"
    },

    "/path/to/foo": {
      name: null,
      type: "local",
      spec: "/path/to/foo",
      raw: "/path/to/foo"
    },
    "file:path/to/foo": {
      name: null,
      type: "local",
      spec: path.resolve(__dirname,"..","path/to/foo"),
      raw: "file:path/to/foo"
    },
    "file:../path/to/foo": {
      name: null,
      type: "local",
      spec: path.resolve(__dirname,"..","../path/to/foo"),
      raw: "file:../path/to/foo"
    },
    "file:///path/to/foo": {
      name: null,
      type: "local",
      spec: "/path/to/foo",
      raw: "file:///path/to/foo"
    },

    "https://server.com/foo.tgz": {
      name: null,
      type: "remote",
      spec: "https://server.com/foo.tgz",
      raw: "https://server.com/foo.tgz"
    },

    "foo@latest": {
      name: "foo",
      type: "tag",
      spec: "latest",
      raw: "foo@latest"
{'fraction_non_alphanumeric': 0.2340354396522902, 'fraction_numerical': 0.01805416248746239, 'mean_word_length': 1.7419798350137488, 'pattern_counts': {'":': 35, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '1309237', 'n_tokens_mistral': 2458, 'n_tokens_neox': 2400, 'n_words': 446}