<commit_before>package sondow.fishies;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class AquariumBuilderTest {

    @Test
    public void testBuildSimpleAquarium() {
        Randomizer random = new TestRandomizer(TestRandomizer.Setting.QUARTER_MAX_HALF_MIN);
        AquariumBuilder builder = new AquariumBuilder(random);
        String actual = builder.build();
        String expected = "　　　　　　　　　🐠\n" + "　　　　　　　　　 🐠\n" + "　　　　　　　　　　\n" + "　　　　　　　　　🐠\n"
                + "　　　　　　　　　 🐠\n" + "　　　　　　　🌾🌿☘️";
        assertEquals(expected, actual);
    }

    @Test
    public void testMidFavoringRandom() {
        Randomizer random = new TestRandomizer(TestRandomizer.Setting.QUARTER_MAX_HALF_MIN);
        AquariumBuilder builder = new AquariumBuilder(random);
        assertEquals(5, builder.midFavoringRandom(10));
        assertEquals(4, builder.midFavoringRandom(10));
        assertEquals(2, builder.midFavoringRandom(10));
        assertEquals(4, builder.midFavoringRandom(9));
        assertEquals(5, builder.midFavoringRandom(9));
        assertEquals(3, builder.midFavoringRandom(9));
        assertEquals(2, builder.midFavoringRandom(8));
        assertEquals(4, builder.midFavoringRandom(8));
        assertEquals(4, builder.midFavoringRandom(8));
        assertEquals(3, builder.midFavoringRandom(8));
        assertEquals(1, builder.midFavoringRandom(7));
        assertEquals(3, builder.midFavoringRandom(7));
        assertEquals(3, builder.midFavoringRandom(7));
        assertEquals(2, builder.midFavoringRandom(6));
        assertEquals(1, builder.midFavoringRandom(6));
        assertEquals(3, builder.midFavoringRandom(6));
        assertEquals(2, builder.midFavoringRandom(5));
        assertEquals(2, builder.midFavoringRandom(5));
        assertEquals(1, builder.midFavoringRandom(5));
        assertEquals(2, builder.midFavoringRandom(4));
        assertEquals(2, builder.midFavoringRandom(4));
        assertEquals(1, builder.midFavoringRandom(4));
        assertEquals(0, builder.midFavoringRandom(3));
        assertEquals(1, builder.midFavoringRandom(3));
        assertEquals(1, builder.midFavoringRandom(3));
        assertEquals(0, builder.midFavoringRandom(2));
        assertEquals(0, builder.midFavoringRandom(2));
        assertEquals(1, builder.midFavoringRandom(2));
        assertEquals(0, builder.midFavoringRandom(1));
        assertEquals(0, builder.midFavoringRandom(1));
        assertEquals(0, builder.midFavoringRandom(1));
    }

    @Test()
    public void testLotsOfRandomOnesToSeeHowTheyLook() {
        boolean dolphinFound = false;
        boolean sharkFound = false;
        boolean squidFound = false;
        boolean octopusFound = false;
        for (int i = 0; i < 100; i++) {
            System.out.println("-------------------------");
            String aquarium = new AquariumBuilder().build();
            if (aquarium.contains("🐬")) {
                dolphinFound = true;
            }
            if (aquarium.contains("🦈")) {
                sharkFound = true;
            }
            if (aquarium.contains("🦑")) {
                squidFound = true;
            }
            if (aquarium.contains("🐙")) {
                octopusFound = true;
            }
            System.out.println(aquarium);
            int length = aquarium.length();
            assert (length < 140);
            System.out.println("length: " + length);
        }
        assertTrue("Missing dolphins 🐬", dolphinFound);
        assertTrue("Missing sharks 🦈", sharkFound);
        assertTrue("Missing squid 🦑", squidFound);
        assertTrue("Missing ocotopuses 🐙", octopusFound);
    }
}
<commit_msg>Made aquarium more readable in unit test.<commit_after>package sondow.fishies;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class AquariumBuilderTest {

    @Test
    public void testBuildSimpleAquarium() {
        Randomizer random = new TestRandomizer(TestRandomizer.Setting.QUARTER_MAX_HALF_MIN);
        AquariumBuilder builder = new AquariumBuilder(random);
        String actual = builder.build();
        String expected = "" +
                "　　　　　　　　　🐠\n" +
                "　　　　　　　　　 🐠\n" +
                "　　　　　　　　　　\n" +
                "　　　　　　　　　🐠\n" +
                "　　　　　　　　　 🐠\n" +
                "　　　　　　　🌾🌿☘️";
        assertEquals(expected, actual);
    }

    @Test
    public void testMidFavoringRandom() {
        Randomizer random = new TestRandomizer(TestRandomizer.Setting.QUARTER_MAX_HALF_MIN);
        AquariumBuilder builder = new AquariumBuilder(random);
        assertEquals(5, builder.midFavoringRandom(10));
        assertEquals(4, builder.midFavoringRandom(10));
        assertEquals(2, builder.midFavoringRandom(10));
        assertEquals(4, builder.midFavoringRandom(9));
        assertEquals(5, builder.midFavoringRandom(9));
        assertEquals(3, builder.midFavoringRandom(9));
        assertEquals(2, builder.midFavoringRandom(8));
        assertEquals(4, builder.midFavoringRandom(8));
        assertEquals(4, builder.midFavoringRandom(8));
        assertEquals(3, builder.midFavoringRandom(8));
        assertEquals(1, builder.midFavoringRandom(7));
        assertEquals(3, builder.midFavoringRandom(7));
        assertEquals(3, builder.midFavoringRandom(7));
        assertEquals(2, builder.midFavoringRandom(6));
        assertEquals(1, builder.midFavoringRandom(6));
        assertEquals(3, builder.midFavoringRandom(6));
        assertEquals(2, builder.midFavoringRandom(5));
        assertEquals(2, builder.midFavoringRandom(5));
        assertEquals(1, builder.midFavoringRandom(5));
        assertEquals(2, builder.midFavoringRandom(4));
        assertEquals(2, builder.midFavoringRandom(4));
        assertEquals(1, builder.midFavoringRandom(4));
        assertEquals(0, builder.midFavoringRandom(3));
        assertEquals(1, builder.midFavoringRandom(3));
        assertEquals(1, builder.midFavoringRandom(3));
        assertEquals(0, builder.midFavoringRandom(2));
        assertEquals(0, builder.midFavoringRandom(2));
        assertEquals(1, builder.midFavoringRandom(2));
        assertEquals(0, builder.midFavoringRandom(1));
        assertEquals(0, builder.midFavoringRandom(1));
        assertEquals(0, builder.midFavoringRandom(1));
    }

    @Test()
    public void testLotsOfRandomOnesToSeeHowTheyLook() {
        boolean dolphinFound = false;
        boolean sharkFound = false;
        boolean squidFound = false;
        boolean octopusFound = false;
        for (int i = 0; i < 100; i++) {
            System.out.println("-------------------------");
            String aquarium = new AquariumBuilder().build();
            if (aquarium.contains("🐬")) {
                dolphinFound = true;
            }
            if (aquarium.contains("🦈")) {
                sharkFound = true;
            }
            if (aquarium.contains("🦑")) {
                squidFound = true;
            }
            if (aquarium.contains("🐙")) {
                octopusFound = true;
            }
            System.out.println(aquarium);
            int length = aquarium.length();
            assert (length < 140);
            System.out.println("length: " + length);
        }
        assertTrue("Missing dolphins 🐬", dolphinFound);
        assertTrue("Missing sharks 🦈", sharkFound);
        assertTrue("Missing squid 🦑", squidFound);
        assertTrue("Missing ocotopuses 🐙", octopusFound);
    }
}

{'fraction_non_alphanumeric': 0.12465263993648273, 'fraction_numerical': 0.019055180627233027, 'mean_word_length': 2.479742173112339, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6884536', 'n_tokens_mistral': 2343, 'n_tokens_neox': 2213, 'n_words': 368}