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

describe('exports', function(){
  it('should export a valid version', function(){
    semver.valid(zmq.version).should.be.ok;
  });

  it('should generate valid curve keypair', function(done) {
    if (!semver.gte(zmq.version,'4.0.0') || require('os').platform() == 'win32'){
      done();
      return console.warn('Test requires libzmq >= 4 compiled with libsodium');
    }
    var curve = zmq.curveKeypair();
    should.exist(curve);
    should.exist(curve.public);
    should.exist(curve.secret);
    curve.public.length.should.equal(40);
    curve.secret.length.should.equal(40);
    done();
  }); 

  it('should export socket types and options', function(){<commit_msg>Skip curve export test if libsodium is missing (#509)<commit_after>
var zmq = require('..')
  , should = require('should')
  , semver = require('semver');

describe('exports', function(){
  it('should export a valid version', function(){
    semver.valid(zmq.version).should.be.ok;
  });

  it('should generate valid curve keypair', function(done) {
    try {
      var rep = zmq.socket('rep');
      rep.curve_server = 0;
    } catch(e) {
      console.log("libsodium seems to be missing (skipping curve test)");
      done();
      return;
    }

    var curve = zmq.curveKeypair();
    should.exist(curve);
    should.exist(curve.public);
    should.exist(curve.secret);
    curve.public.length.should.equal(40);
    curve.secret.length.should.equal(40);
    done();
  });

  it('should export socket types and options', function(){
{'fraction_non_alphanumeric': 0.16790582403965304, 'fraction_numerical': 0.011152416356877323, 'mean_word_length': 3.5365168539325844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4391347', 'n_tokens_mistral': 536, 'n_tokens_neox': 500, 'n_words': 115}