<commit_before>import circularBuffer from './circular-buffer';
import { bufferFullException as bufferFullException } from './circular-buffer';
import { bufferEmptyException as bufferEmptyException } from './circular-buffer';


describe('CircularBuffer', () => {

  it('reading an empty buffer throws a BufferEmptyException', () => {
    const buffer = circularBuffer(1);
    expect(buffer.read).toThrow(bufferEmptyException());
  });

  xit('write and read back one item', () => {
    const buffer = circularBuffer(1);
    buffer.write('1');
    expect(buffer.read()).toBe('1');
    expect(buffer.read).toThrow(bufferEmptyException());
  });

  xit('write and read back multiple items', () => {
    const buffer = circularBuffer(2);
    buffer.write('1');
    buffer.write('2');
    expect(buffer.read()).toBe('1');
    expect(buffer.read()).toBe('2');
    expect(buffer.read).toThrow(bufferEmptyException());
  });

  xit('clearing a buffer', () => {
    const buffer = circularBuffer(2);
    buffer.write('1');
    buffer.write('2');
    buffer.clear();
    expect(buffer.read).toThrowError;
    buffer.write('3');
    buffer.write('4');
    expect(buffer.read()).toBe('3');
    expect(buffer.read()).toBe('4');
  });

  xit('alternate write and read', () => {
    const buffer = circularBuffer(2);
    buffer.write('1');
    expect(buffer.read()).toBe('1');
    buffer.write('2');
    expect(buffer.read()).toBe('2');
  });<commit_msg>Assertion not executed in Circular Buffer tests<commit_after>import circularBuffer from './circular-buffer';
import { bufferFullException as bufferFullException } from './circular-buffer';
import { bufferEmptyException as bufferEmptyException } from './circular-buffer';


describe('CircularBuffer', () => {

  it('reading an empty buffer throws a BufferEmptyException', () => {
    const buffer = circularBuffer(1);
    expect(buffer.read).toThrow(bufferEmptyException());
  });

  xit('write and read back one item', () => {
    const buffer = circularBuffer(1);
    buffer.write('1');
    expect(buffer.read()).toBe('1');
    expect(buffer.read).toThrow(bufferEmptyException());
  });

  xit('write and read back multiple items', () => {
    const buffer = circularBuffer(2);
    buffer.write('1');
    buffer.write('2');
    expect(buffer.read()).toBe('1');
    expect(buffer.read()).toBe('2');
    expect(buffer.read).toThrow(bufferEmptyException());
  });

  xit('clearing a buffer', () => {
    const buffer = circularBuffer(2);
    buffer.write('1');
    buffer.write('2');
    buffer.clear();
    expect(buffer.read).toThrow(bufferEmptyException());
    buffer.write('3');
    buffer.write('4');
    expect(buffer.read()).toBe('3');
    expect(buffer.read()).toBe('4');
  });

  xit('alternate write and read', () => {
    const buffer = circularBuffer(2);
    buffer.write('1');
    expect(buffer.read()).toBe('1');
    buffer.write('2');
    expect(buffer.read()).toBe('2');
  });
{'fraction_non_alphanumeric': 0.19324001365653806, 'fraction_numerical': 0.014339364970979856, 'mean_word_length': 4.131348511383537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3514550', 'n_tokens_mistral': 874, 'n_tokens_neox': 849, 'n_words': 164}