<commit_before>var path = require("path")
  , ivur = require(path.join(__dirname, "..", "index.js"));

module.exports = {
    "EXTRACT Mode": {
    "単一の$EXTRACT": function (test) {
      ivur("http://ascii.jp/elem/000/000/686/686849/img.html", function (uri, referer, res) {
        test.equal(uri, "http://ascii.jp/elem/000/000/686/686849/sv1_c_640x480.jpg");
        test.done();
      });
    }
    , "単一の$EXTRACT 不正クエリ付き": function (test) {
      ivur("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=77777&test=test_query", function (uri, referer, res) {
        test.equal(uri, "http://img02.pixiv.net/img/akeno9ys/77777.jpg");
        test.equal(referer, "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=77777");
        test.done();
      });
    }
    , "jpg.toを正しく変換できる(Refererをnullで設定すると取得できない)": function (test) {
      ivur("http://アップル.jpg.to/", function (uri, referer, res) {
        test.ok(/^http:\/\//.test(uri));
        test.done();
      });
    }
    , "複数の$EXTRACT": function (test) {
      ivur("http://www.amazon.co.jp/gp/product/images/B00810VSM0/ref=dp_image_0", function (uri, referer, res) {
        test.ok(/^http:\/\/\w+\.images-amazon\.com\/images\/I\/.*$/.test(uri));
        test.done();
      });
    }
    , "リファラ付き": function (test) {
      ivur("http://hobby-c.rash.jp/igafioz/ref/1330986364242.htm", function (uri, referer, res) {
        test.equal(uri, "http://hobby-c.rash.jp/igafioz/src/1330986364242.jpg");
        test.done();
      });
    }
  }
  , "VIEWER Mode": {
    "正しく取得できる": function (test) {
      ivur("http://map.yahoo.co.jp/pl?type=scroll&lat=35.67832667&lon=139.77044378&sc=3&mode=map&pointer=on", function (uri, referer, res) {
        test.equal(uri, "http://img.map.yahoo.co.jp/ymap/mk_map?type=scroll&lat=35.67832667&lon=139.77044378&sc=3&mode=map&pointer=on");
        test.done();
      });
    }
  }
  , "DEFAULT Mode": {
    "正しく取得できる": function (test) {
      ivur("http://upload.wikimedia.org/wikipedia/en/f/fa/Google_Chrome_2011_computer_icon.svg", function (uri, referer, res) {
        test.equal(uri, "http://upload.wikimedia.org/wikipedia/en/thumb/f/fa/Google_Chrome_2011_computer_icon.svg/1000px-Google_Chrome_2011_computer_icon.svg.png");
        test.done();
      });
    }
  }
  , "NG": {
    "正しくNG判定できている": function (test) {
      ivur("http://ipatukouta.altervista.org/test.jpg", function (uri, referer, res) {
        test.equal(uri, null);
        test.done();
      });
    }
  }
  , "Error": {
    "http request timeout": function (test) {
      ivur({uri: "http://ascii.jp/elem/000/000/686/686849/img.html", timeout: 1}, function () {}).on("error", function (error) {<commit_msg>Fix test<commit_after>var path = require("path")
  , ivur = require(path.join(__dirname, "..", "index.js"));

module.exports = {
    "EXTRACT Mode": {
    "単一の$EXTRACT": function (test) {
      ivur("http://ascii.jp/elem/000/000/686/686849/img.html", function (uri, referer, res) {
        test.equal(uri, "http://ascii.jp/elem/000/000/686/686849/sv1_c_640x480.jpg");
        test.done();
      });
    }
    , "単一の$EXTRACT 不正クエリ付き": function (test) {
      ivur("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=77777&test=test_query", function (uri, referer, res) {
        test.ok(/77777\.(jpg|png)$/.test(uri));
        test.equal(referer, "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=77777");
        test.done();
      });
    }
    , "jpg.toを正しく変換できる(Refererをnullで設定すると取得できない)": function (test) {
      ivur("http://アップル.jpg.to/", function (uri, referer, res) {
        test.ok(/^http:\/\//.test(uri));
        test.done();
      });
    }
    , "複数の$EXTRACT": function (test) {
      ivur("http://www.amazon.co.jp/gp/product/images/B00810VSM0/ref=dp_image_0", function (uri, referer, res) {
        test.ok(/^http:\/\/\w+\.images-amazon\.com\/images\/I\/.*$/.test(uri));
        test.done();
      });
    }
  }
  , "VIEWER Mode": {
    "正しく取得できる": function (test) {
      ivur("http://map.yahoo.co.jp/pl?type=scroll&lat=35.67832667&lon=139.77044378&sc=3&mode=map&pointer=on", function (uri, referer, res) {
        test.equal(uri, "http://img.map.yahoo.co.jp/ymap/mk_map?type=scroll&lat=35.67832667&lon=139.77044378&sc=3&mode=map&pointer=on");
        test.done();
      });
    }
  }
  , "DEFAULT Mode": {
    "正しく取得できる": function (test) {
      ivur("http://upload.wikimedia.org/wikipedia/en/f/fa/Google_Chrome_2011_computer_icon.svg", function (uri, referer, res) {
        test.equal(uri, "http://upload.wikimedia.org/wikipedia/en/thumb/f/fa/Google_Chrome_2011_computer_icon.svg/1000px-Google_Chrome_2011_computer_icon.svg.png");
        test.done();
      });
    }
  }
  , "NG": {
    "正しくNG判定できている": function (test) {
      ivur("http://ipatukouta.altervista.org/test.jpg", function (uri, referer, res) {
        test.equal(uri, null);
        test.done();
      });
    }
  }
  , "Error": {
    "http request timeout": function (test) {
      ivur({uri: "http://ascii.jp/elem/000/000/686/686849/img.html", timeout: 1}, function () {}).on("error", function (error) {
{'fraction_non_alphanumeric': 0.20654516950813248, 'fraction_numerical': 0.05859298451891044, 'mean_word_length': 2.9322033898305087, 'pattern_counts': {'":': 27, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '1663002', 'n_tokens_mistral': 2262, 'n_tokens_neox': 2036, 'n_words': 223}