<commit_before>QUnit.module('data.queueHash');

QUnit.test('addTo and getFrom', function(assert) {
  var qh = smodules.data.queueHash();

  qh.addTo('list', 'a');
  qh.addTo('list', 'b');

  assert.strictEqual(qh.has('list'), true);
  assert.strictEqual(qh.sizeOf('list'), 2);
  assert.strictEqual(qh.getFrom('list'), 'a');
  assert.strictEqual(qh.sizeOf('list'), 1);
  assert.strictEqual(qh.getFrom('list'), 'b');
  assert.strictEqual(qh.sizeOf('list'), 0);

  qh.remove('list');

  assert.strictEqual(qh.has('list'), false);
});

QUnit.test('check keys', function(assert) {
  var qh = smodules.data.queueHash();

  qh.addTo('queue1', 'a');

  assert.strictEqual(qh.getKeys().length, 1);
  assert.strictEqual(qh.getKeys()[0], 'queue1');

  qh.addTo('queue2', 'A');

  assert.strictEqual(qh.getKeys().length, 2);
  assert.strictEqual(qh.getKeys()[0], 'queue1');
  assert.strictEqual(qh.getKeys()[1], 'queue2');

  qh.clear();

  assert.strictEqual(0, qh.getKeys().length);
});

QUnit.test('using not existing key', function(assert) {
  var qh = smodules.data.queueHash();

  assert.strictEqual(qh.has('hoge'), false);
  assert.strictEqual(qh.sizeOf('hoge'), 0);
  assert.strictEqual(typeof qh.getFrom('hoge'), 'undefined');
});<commit_msg>[QUnit] Implement beforeEach in data.queueHash-test.js<commit_after>QUnit.module('data.queueHash', {
  beforeEach: function() {
    this.qh = smodules.data.queueHash();
  },
});

QUnit.test('addTo and getFrom', function(assert) {
  this.qh.addTo('list', 'a');
  this.qh.addTo('list', 'b');

  assert.strictEqual(this.qh.has('list'), true);
  assert.strictEqual(this.qh.sizeOf('list'), 2);
  assert.strictEqual(this.qh.getFrom('list'), 'a');
  assert.strictEqual(this.qh.sizeOf('list'), 1);
  assert.strictEqual(this.qh.getFrom('list'), 'b');
  assert.strictEqual(this.qh.sizeOf('list'), 0);

  this.qh.remove('list');

  assert.strictEqual(this.qh.has('list'), false);
});

QUnit.test('check keys', function(assert) {
  this.qh.addTo('queue1', 'a');

  assert.strictEqual(this.qh.getKeys().length, 1);
  assert.strictEqual(this.qh.getKeys()[0], 'queue1');

  this.qh.addTo('queue2', 'A');

  assert.strictEqual(this.qh.getKeys().length, 2);
  assert.strictEqual(this.qh.getKeys()[0], 'queue1');
  assert.strictEqual(this.qh.getKeys()[1], 'queue2');

  this.qh.clear();

  assert.strictEqual(this.qh.getKeys().length, 0);
});

QUnit.test('using not existing key', function(assert) {
  assert.strictEqual(this.qh.has('hoge'), false);
  assert.strictEqual(this.qh.sizeOf('hoge'), 0);
  assert.strictEqual(typeof this.qh.getFrom('hoge'), 'undefined');
});
{'fraction_non_alphanumeric': 0.22277992277992278, 'fraction_numerical': 0.011583011583011582, 'mean_word_length': 5.461346633416459, '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': '4806980', 'n_tokens_mistral': 1019, 'n_tokens_neox': 986, 'n_words': 129}