<commit_before>var zmq = require('..')
  , should = require('should')
  , semver = require('semver');

describe('socket.xpub-xsub', function () {
    var pub, sub, xpub, xsub;
    
    beforeEach(function () {
        pub = zmq.socket('pub');
        sub = zmq.socket('sub');
		xpub = zmq.socket('xpub');
		xsub = zmq.socket('xsub');
    });
    
    it('should support pub-sub tracing and filtering', function (done) {
        var n = 0;
		
		if (!semver.gte(zmq.version, '3.1.0')) {
			done();
			return console.warn('Test requires libzmq >= 3.1.0');
		}

		pub.bindSync('tcp://*:5556');	
		xsub.connect('tcp://127.0.0.1:5556');
		xpub.bindSync('tcp://*:5555'); 		<commit_msg>Moved xpub xsub socket creation<commit_after>var zmq = require('..')
  , should = require('should')
  , semver = require('semver');

describe('socket.xpub-xsub', function () {
    var pub, sub, xpub, xsub;
    
    beforeEach(function () {
        pub = zmq.socket('pub');
        sub = zmq.socket('sub');
    });
    
    it('should support pub-sub tracing and filtering', function (done) {    	
		if (!semver.gte(zmq.version, '3.1.0')) {
			done();
			return console.warn('Test requires libzmq >= 3.1.0');
		}
		
		var n = 0;
		xpub = zmq.socket('xpub');
		xsub = zmq.socket('xsub');

		pub.bindSync('tcp://*:5556');	
		xsub.connect('tcp://127.0.0.1:5556');
		xpub.bindSync('tcp://*:5555'); 		
{'fraction_non_alphanumeric': 0.20830298616168974, 'fraction_numerical': 0.03641660597232338, 'mean_word_length': 2.8813559322033897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7358097', 'n_tokens_mistral': 569, 'n_tokens_neox': 509, 'n_words': 96}