<commit_before>package com.github.davidmoten.rx2.internal.flowable.buffertofile;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.util.concurrent.Callable;

import org.junit.Assert;
import org.junit.Test;

public class PageListTest {

    private static final Callable<File> factory = new Callable<File>() {
        int i = 0;

        @Override
        public File call() throws Exception {
            return new File("target/test" + (++i));
        }
    };

    @Test
    public void testPutOneAndReadLessThanPageSize() {
        PageList p = new PageList(factory, 8);
        p.put(1);
        assertEquals(1, p.read());
    }

    @Test
    public void testPutTwoAndReadLessThanPageSize() {
        PageList p = new PageList(factory, 12);
        p.put(1);
        p.put(2);
        assertEquals(1, p.read());
        assertEquals(2, p.read());
    }
    
    @Test
    public void testPutTwoAndReadEqualsPageSize() {
        PageList p = new PageList(factory, 8);
        p.put(1);
        p.put(2);
        assertEquals(1, p.read());
        assertEquals(2, p.read());
    }
    
    @Test
    public void testPutTwoAndReadMoreThanPageSize() {
        PageList p = new PageList(factory, 5);
        p.put(1);
        p.put(2);
        assertEquals(1, p.read());
        assertEquals(2, p.read());
    }

}
<commit_msg>add tests<commit_after>package com.github.davidmoten.rx2.internal.flowable.buffertofile;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.util.concurrent.Callable;

import org.junit.Test;

public class PageListTest {

    private static final Callable<File> factory = new Callable<File>() {
        int i = 0;

        @Override
        public File call() throws Exception {
            return new File("target/test" + (++i));
        }
    };

    @Test
    public void testPutOneAndReadLessThanPageSize() {
        PageList p = new PageList(factory, 8);
        p.put(1);
        assertEquals(1, p.read());
    }

    @Test
    public void testPutTwoAndReadLessThanPageSize() {
        PageList p = new PageList(factory, 12);
        p.put(1);
        p.put(2);
        assertEquals(1, p.read());
        assertEquals(2, p.read());
    }

    @Test
    public void testPutTwoAndReadEqualsPageSize() {
        PageList p = new PageList(factory, 8);
        p.put(1);
        p.put(2);
        assertEquals(1, p.read());
        assertEquals(2, p.read());
    }

    @Test
    public void testPutTwoAndReadMoreThanPageSize() {
        PageList p = new PageList(factory, 5);
        p.put(1);
        p.put(2);
        assertEquals(1, p.read());
        assertEquals(2, p.read());
    }

    @Test
    public void testPutSixAndReadMultiplePages() {
        PageList p = new PageList(factory, 5);
        p.put(1);
        p.put(2);
        p.put(3);
        p.put(4);
        p.put(5);
        p.put(6);
        assertEquals(1, p.read());
        assertEquals(2, p.read());
        assertEquals(3, p.read());
        assertEquals(4, p.read());
        assertEquals(5, p.read());
        assertEquals(6, p.read());
    }
}

{'fraction_non_alphanumeric': 0.13009888751545118, 'fraction_numerical': 0.016996291718170582, 'mean_word_length': 1.9561643835616438, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3025303', 'n_tokens_mistral': 1037, 'n_tokens_neox': 985, 'n_words': 212}