<commit_before>'use strict';

module.exports.run = function (test, Heap) {
  test('should insert items into the heap', function (t) {
    var heap = new Heap();
    heap.insert(1, null);
    heap.insert(2, null);
    heap.insert(3, null);
    heap.insert(4, null);
    heap.insert(5, null);
    t.same(heap.size(), 5);
    t.end();
  });

  test('should return the inserted node', function (t) {
    var heap = new Heap();
    var ret = heap.insert(1, {foo: 'bar'});
    t.is(ret.key, 1);
    t.same(ret.value, {foo: 'bar'});
    t.end();
  });
};<commit_msg>Add test that checks duplicate keys work<commit_after>'use strict';

module.exports.run = function (test, Heap) {
  test('should insert items into the heap', function (t) {
    var heap = new Heap();
    heap.insert(1, null);
    heap.insert(2, null);
    heap.insert(3, null);
    heap.insert(4, null);
    heap.insert(5, null);
    t.same(heap.size(), 5);
    t.end();
  });

  test('should return the inserted node', function (t) {
    var heap = new Heap();
    var ret = heap.insert(1, {foo: 'bar'});
    t.is(ret.key, 1);
    t.same(ret.value, {foo: 'bar'});
    t.end();
  });

  test('should insert multiple items with the same key', function (t) {
    var heap = new Heap();
    heap.insert(1, null);
    heap.insert(1, null);
    t.is(1, heap.extractMinimum().key);
    t.is(1, heap.extractMinimum().key);
    t.end();
  });
};
{'fraction_non_alphanumeric': 0.19340974212034384, 'fraction_numerical': 0.014326647564469915, 'mean_word_length': 2.9800569800569803, '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': '6562825', 'n_tokens_mistral': 512, 'n_tokens_neox': 502, 'n_words': 135}