<commit_before>
var u = require('../')
var os = require('os')
var path = require('path')
var shasum = require('shasum')
var fs = require('fs')
var rimraf = require('rimraf')
var assert = require('assert')
var test = require('tape')

var testCache = path.join(os.tmpdir(), 'test-cache' + Date.now())
var testTarget = path.join(os.tmpdir(), 'test-target' + Date.now())

var opts = {cache: testCache, target: testTarget}

var expectedPkg = path.join(testTarget, 'package', 'package.json')
var expectedHash = '2b293fe42342bd9abf103963ada817acc9588c9b'

//first should download,
//and then unpack from cache.
test('unpack curry', function (t) {
  u.unpack('curry@0.0.3', opts, function (err, _hash) {
    console.log('HASH', _hash)
    t.equal(_hash, 'da7c18390af7d624ca90e380c2146dbf7719847a')

    fs.readFile(path.join(testCache, 'curry', '0.0.3', 'package.tgz'), function (err, b) {
      console.log('SHASUM', shasum(b))

    })<commit_msg>let tests run of 0.8<commit_after>
var u = require('../')
var os = require('os')
var path = require('path')
var shasum = require('shasum')
var fs = require('fs')
var rimraf = require('rimraf')
var assert = require('assert')
var test = require('tape')

var tmpdir = os.tmpdir 
    ? os.tmpdir() 
    : process.env.TMPDIR || '/tmp'

var testCache = path.join(tmpdir, 'test-cache' + Date.now())
var testTarget = path.join(tmpdir, 'test-target' + Date.now())

var opts = {cache: testCache, target: testTarget}

var expectedPkg = path.join(testTarget, 'package', 'package.json')
var expectedHash = '2b293fe42342bd9abf103963ada817acc9588c9b'

//first should download,
//and then unpack from cache.
test('unpack curry', function (t) {
  u.unpack('curry@0.0.3', opts, function (err, _hash) {
    console.log('HASH', _hash)
    t.equal(_hash, 'da7c18390af7d624ca90e380c2146dbf7719847a')

    fs.readFile(path.join(testCache, 'curry', '0.0.3', 'package.tgz'), function (err, b) {
      console.log('SHASUM', shasum(b))

    })
{'fraction_non_alphanumeric': 0.1743353783231084, 'fraction_numerical': 0.05828220858895705, 'mean_word_length': 4.722222222222222, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4071761', 'n_tokens_mistral': 793, 'n_tokens_neox': 728, 'n_words': 168}