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

// version

semver.valid(zmq.version).should.be.ok;

// socket types and socket opts

// All versions.
var socketList = [
  'PUB',
  'SUB',
  'REQ',
  'XREQ',
  'REP',
  'XREP',
  'DEALER',
  'ROUTER',
  'PUSH',
  'PULL',
  'PAIR',
  'AFFINITY',
  'IDENTITY',
  'SUBSCRIBE',
  'UNSUBSCRIBE',
  'RATE',
  'RECOVERY_IVL',
  'SNDBUF',
  'RCVBUF',
  'RCVMORE',
  'FD',
  'EVENTS',
  'TYPE',
  'LINGER',
  'RECONNECT_IVL',
  'BACKLOG',
  'POLLIN',
  'POLLOUT',
  'POLLERR',
  'SNDMORE'
];

// 2.x only.
if (semver.satisfies(zmq.version, '2.x')) {
  socketList.concat([
    'HWM',
    'SWAP',
    'MCAST_LOOP',
    'NOBLOCK'
  ]);
}

// 3.x only.
if (semver.satisfies(zmq.version, '3.x')) {
  socketList.concat([
    'XPUB',
    'XSUB',
    'SNDHWM',
    'RCVHWM'
  ]);
}

// 3.2 and above.
if (semver.gte('3.2')) {
  socketList.concat([
    'LAST_ENDPOINT'
  ]);
}

socketList.forEach(function(typeOrProp){
  zmq['ZMQ_' + typeOrProp].should.be.a('number');
});

// states

['STATE_READY', 'STATE_BUSY', 'STATE_CLOSED'].forEach(function(state){
  zmq[state].should.be.a('number');
})

// constructors

zmq.Context.should.be.a('function');
zmq.Socket.should.be.a('function');

// methods

zmq.socket.should.be.a('function');<commit_msg>Renamed a variable. Didn't make a lot of sense as it was.<commit_after>
var zmq = require('../')
  , should = require('should')
  , semver = require('semver');

// version

semver.valid(zmq.version).should.be.ok;

// socket types and socket opts

// All versions.
var constants = [
  'PUB',
  'SUB',
  'REQ',
  'XREQ',
  'REP',
  'XREP',
  'DEALER',
  'ROUTER',
  'PUSH',
  'PULL',
  'PAIR',
  'AFFINITY',
  'IDENTITY',
  'SUBSCRIBE',
  'UNSUBSCRIBE',
  'RATE',
  'RECOVERY_IVL',
  'SNDBUF',
  'RCVBUF',
  'RCVMORE',
  'FD',
  'EVENTS',
  'TYPE',
  'LINGER',
  'RECONNECT_IVL',
  'BACKLOG',
  'POLLIN',
  'POLLOUT',
  'POLLERR',
  'SNDMORE'
];

// 2.x only.
if (semver.satisfies(zmq.version, '2.x')) {
  constants.concat([
    'HWM',
    'SWAP',
    'MCAST_LOOP',
    'NOBLOCK'
  ]);
}

// 3.x only.
if (semver.satisfies(zmq.version, '3.x')) {
  constants.concat([
    'XPUB',
    'XSUB',
    'SNDHWM',
    'RCVHWM'
  ]);
}

// 3.2 and above.
if (semver.gte('3.2')) {
  constants.concat([
    'LAST_ENDPOINT'
  ]);
}

constants.forEach(function(typeOrProp){
  zmq['ZMQ_' + typeOrProp].should.be.a('number');
});

// states

['STATE_READY', 'STATE_BUSY', 'STATE_CLOSED'].forEach(function(state){
  zmq[state].should.be.a('number');
})

// constructors

zmq.Context.should.be.a('function');
zmq.Socket.should.be.a('function');

// methods

zmq.socket.should.be.a('function');
{'fraction_non_alphanumeric': 0.22349464351680828, 'fraction_numerical': 0.005910602142593277, 'mean_word_length': 3.257861635220126, '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': '2601856', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1219, 'n_words': 188}