<commit_before>var test = require('tape'),
	pull = require('pull-stream'),
	pushable = require('pull-pushable'),
	Peer = require('../peer'),
	peer;

test('create a new peer', function(t) {
	t.plan(1);
	peer = new Peer();
	t.ok(peer.id, 'new peer created');
});

test('can send messages to the peer', function(t) {
	var messages = pushable();

	t.plan(1);

	pull(
		messages,
		peer.inbound()
	);

	peer.on('data', function(message) {
		t.equal(message, 'hello', 'received message successfully');
	});

	messages.push('hello');
});<commit_msg>Enough receive tests for now<commit_after>var test = require('tape'),
	pull = require('pull-stream'),
	pushable = require('pull-pushable'),
	Peer = require('../peer');

test('create a new peer', function(t) {
	var peer;

	t.plan(1);
	peer = new Peer();
	t.ok(peer.id, 'new peer created');
});

test('can send messages to the peer', function(t) {
	var messages = pushable(),
		peer = new Peer();

	t.plan(1);

	pull(
		messages,
		peer.inbound()
	);

	peer.on('data', function(message) {
		t.equal(message, 'hello', 'received message successfully');
	});

	messages.push('hello');
});

test('triggers a disconnect event when the incoming stream ends', function(t) {
	var messages = pushable(),
		peer = new Peer();

	t.plan(1);

	pull(
		messages,
		peer.inbound()
	);

	peer.on('disconnect', function() {
		t.pass('received a disconnect event');
	});

	messages.push('hello');
	messages.end();
});
{'fraction_non_alphanumeric': 0.1959694232105629, 'fraction_numerical': 0.0034746351633078527, 'mean_word_length': 4.393258426966292, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1509071', 'n_tokens_mistral': 528, 'n_tokens_neox': 494, 'n_words': 126}