<commit_before>var assert = require('assert'),
    _ = require('lodash');

describe('Semantic Interface', function() {

  describe('Binary Type', function() {
    describe('with valid data', function() {

      /////////////////////////////////////////////////////
      // TEST METHODS
      ////////////////////////////////////////////////////

      it('should store proper binary value', function(done) {
        // use a string
        var str = 'test the things';
        // to make a binary thing
        var buf = new Buffer(str, "utf-8");
        // store the binary thing
        Semantic.User.create({ avatar: buf }, function(err, record) {
          assert(!err);
          // read out the stored binary thing
          var outbuf = new Buffer(record.avatar);
          
          assert(outbuf.toString('utf-8') === str);
          done();
        });
      });

    });
  });
});<commit_msg>Show error in failure output.<commit_after>var assert = require('assert'),
    _ = require('lodash');

describe('Semantic Interface', function() {

  describe('Binary Type', function() {
    describe('with valid data', function() {

      /////////////////////////////////////////////////////
      // TEST METHODS
      ////////////////////////////////////////////////////

      it('should store proper binary value', function(done) {
        // use a string
        var str = 'test the things';
        // to make a binary thing
        var buf = new Buffer(str, "utf-8");
        // store the binary thing
        Semantic.User.create({ avatar: buf }, function(err, record) {
          assert(!err, err);
          // read out the stored binary thing
          var outbuf = new Buffer(record.avatar);
          
          assert(outbuf.toString('utf-8') === str);
          done();
        });
      });

    });
  });
});
{'fraction_non_alphanumeric': 0.241398143091207, 'fraction_numerical': 0.002184598580010923, 'mean_word_length': 1.4137022397891963, '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': '3419931', 'n_tokens_mistral': 455, 'n_tokens_neox': 432, 'n_words': 131}