<commit_before><commit_msg>Rewrite the ‘alphanumeric’ test into Mocha<commit_after>if (typeof module !== 'undefined' && module.exports) {
  var expect = require('expect.js');
  var Amanda = require('../../../../dist/latest.js');
}

/**
 * Format
 * --------------------
 */
suite('JSON/Attribute/format#alphanumeric', function() {

  var count = 0;

  /**
   * Schema
   */
  var schema = {
    format: 'alphanumeric'
  };

  /**
   * Validator
   */
  var Validator = new Amanda('json');

  test('should not return an error', function() {
    [
      'abc123',
      '123abc',
      'a1b2c3',
      'abc',
      'ABC',
      'Abc',
      '123',
      123
    ].forEach(function(data) {
      Validator.validate(data, schema, function(error) {
        count += 1;
        expect(error).to.not.be.ok();
      });  
    });
  });

  test('should return an error', function() {
    [
      '+@#$~^*{}',
      'lorem ipsum',
      ' ',
    ].forEach(function(data) {
      Validator.validate(data, schema, function(error) {
        count += 1;
        expect(error).to.be.ok();
      });  
    });
  });

  test('should run 11 times', function() {
    expect(count).to.be.eql(11);
  });

});
{'fraction_non_alphanumeric': 0.21398483572030327, 'fraction_numerical': 0.018534119629317607, 'mean_word_length': 2.085714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 1, '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': '6878939', 'n_tokens_mistral': 418, 'n_tokens_neox': 394, 'n_words': 73}