Files: 146a443d177d4fac8520cac615abdb421a4df30e / test / index-pack.js
677 bytesRaw
1 | var tape = require('tape') |
2 | var indexPack = require('../lib/index-pack') |
3 | var pull = require('pull-stream') |
4 | var toPull = require('stream-to-pull-stream') |
5 | var cp = require('child_process') |
6 | |
7 | tape('index-pack produces output', function (t) { |
8 | var child = cp.spawn('git', ['pack-objects', '--stdout', '--revs']) |
9 | child.stdin.end('HEAD\n') |
10 | indexPack(toPull.source(child.stdout), function (err, idx) { |
11 | t.error(err, 'index pack') |
12 | pull(idx, pull.reduce(function (val, buf) { |
13 | return val + buf.length |
14 | }, 0, function (err, length) { |
15 | t.error(err, 'read index pack') |
16 | t.comment('len: ' + length) |
17 | t.ok(length > 0, 'length') |
18 | t.end() |
19 | })) |
20 | }) |
21 | }) |
22 |
Built with git-ssb-web