Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code examples #538

Merged
merged 4 commits into from Dec 27, 2015
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

undo accidental test changes

  • Loading branch information
feross committed Dec 27, 2015
commit 081385d06aab74364b7aed53bbd6dbed134cfbd9
@@ -70,7 +70,7 @@ test('Command line: webtorrent info /path/to/file.torrent', function (t) {
test('Command line: webtorrent info magnet_uri', function (t) {
t.plan(2)

var leavesMagnetURI = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=http%3A%2F%2Ftracker.bittorrent.am%2Fannounce&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ffr33domtracker.h33t.com%3A3310%2Fannounce&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80'
var leavesMagnetURI = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=http%3A%2F%2Ftracker.bittorrent.am%2Fannounce&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ffr33domtracker.h33t.com%3A3310%2Fannounce&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80'

cp.exec(CMD + ' info "' + leavesMagnetURI + '"', function (err, data) {
t.error(err)
@@ -95,7 +95,7 @@ test('Command line: webtorrent create /path/to/file', function (t) {
child.stdout.on('end', function () {
var buf = Buffer.concat(chunks)
var parsedTorrent = parseTorrent(new Buffer(buf, 'binary'))
t.deepEqual(parsedTorrent.infoHash, '6a9759bffd5c0af65319979fb7832189f4f3c35d')
t.deepEqual(parsedTorrent.infoHash, 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36')
})
})

@@ -5,7 +5,7 @@ var RarityMap = require('../lib/rarity-map')
var Swarm = require('bittorrent-swarm')
var test = require('tape')

var infoHash = '6a9759bffd5c0af65319979fb7832189f4f3c35d'
var infoHash = 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36'
var peerId1 = '-WW0001-' + hat(48)

test('Rarity map usage', function (t) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.