<commit_before>package io.qala.datagen.junit5;

import org.junit.jupiter.api.Nested;

import static io.qala.datagen.RandomShortApi.english;
import static io.qala.datagen.RandomShortApi.numeric;
import static org.junit.jupiter.api.Assertions.*;
@SuppressWarnings("unused"/*some tests just check that the method param doesn't break anything but don't use it*/)
class Junit5ParameterizedTest {
    @Nested class RandomIntGenerator {
        @RandomInt(min = 1, max = 10)
        void generatesIntInBoundaries(int param) {
            assertTrue(param <= 10);
            assertTrue(param >= 1);
        }

        @RandomInt @RandomInt
        void generatesAnyNumberByDefault(int param) {
            assertChangedFromLastTime(param);
        }

        @RandomInt(name = "zero")
        void ignoresName_if2ndParamIsNotPresent(int param) {
        }

        @RandomInt(name = "blah")
        void passesName_asSecondParam(int param, String name) {
            assertEquals("blah", name);
        }
    }
    @Nested class RandomIntsGenerator {
        @RandomInt(min = 1, name = "greater than zero")
        @RandomInt(max = -1, name = "less than zero")
        void canGenerateMultipleInts(int param) {
            assertNotEquals(0, param);
            assertChangedFromLastTime(param);
        }

        @RandomInt(name = "zero") @RandomInt
        void ignoresName_if2ndParamIsNotPresent(int param) {
        }

        @RandomInt(name = "blah") @RandomInt(name = "blah")
        void passesName_asSecondParam(int param, String name) {
            assertEquals("blah", name);
        }

        @RandomInt(min = 2, max = 10) @RandomInt(min = 2, max = 10)
        void nameIsGeneric_byDefault(int value, String name) {
            assertEquals("int from 2 to 10", name);
        }
    }

    @Nested class RandomLongGenerator {
        @RandomLong(min = 1, max = 10)
        void generatesIntInBoundaries(long param) {
            assertTrue(param <= 10);
            assertTrue(param >= 1);
        }

        @RandomLong @RandomLong @SuppressWarnings("ConstantConditions")
        void generatesAnyNumberByDefault(long param) {
            assertTrue(param >= Long.MIN_VALUE);
            assertTrue(param <= Long.MAX_VALUE);
            assertChangedFromLastTime(param);
        }

        @RandomLong(name = "zero")
        void ignoresName_if2ndParamIsNotPresent(long param) {
        }

        @RandomLong(name = "blah")
        void passesName_asSecondParam(long param, String name) {
            assertEquals("blah", name);
        }
    }
    @Nested class RandomLongsGenerator {
        @RandomLong(min = 1, name = "greater than zero")
        @RandomLong(max = -1, name = "less than zero")
        void canGenerateMultipleNumbers(long param) {
            assertNotEquals(0, param);
            assertChangedFromLastTime(param);
        }

        @RandomLong(name = "zero") @RandomLong
        void ignoresName_if2ndParamIsNotPresent(long param) {
        }

        @RandomLong(name = "blah") @RandomLong(name = "blah")
        void passesName_asSecondParam(long param, String name) {
            assertEquals("blah", name);
        }

        @RandomLong(min = 2, max = 10) @RandomLong(min = 2, max = 10)
        void nameIsGeneric_byDefault(long value, String name) {
            assertEquals("long from 2 to 10", name);
        }
    }

    @Nested class RandomDoubleGenerator {
        @RandomDouble(min = 1, max = 10)
        void generatesIntInBoundaries(double param) {
            assertTrue(param <= 10);
            assertTrue(param >= 1);
        }

        @RandomDouble @RandomDouble @SuppressWarnings("ConstantConditions")
        void generatesAnyNumberByDefault(double param) {
            assertTrue(param >= Long.MIN_VALUE);
            assertTrue(param <= Long.MAX_VALUE);
            assertChangedFromLastTime(param);
        }

        @RandomDouble(name = "zero")
        void ignoresName_if2ndParamIsNotPresent(double param) {
        }

        @RandomDouble(name = "blah")
        void passesName_asSecondParam(double param, String name) {
            assertEquals("blah", name);
        }
    }
    @Nested class RandomDoublesGenerator {
        @RandomDouble(min = 1, name = "greater than zero")
        @RandomDouble(max = -1, name = "less than zero")
        void canGenerateMultipleNumbers(double param) {
            assertNotEquals(0, param);
            assertChangedFromLastTime(param);
        }

        @RandomDouble(name = "zero") @RandomDouble
        void ignoresName_if2ndParamIsNotPresent(double param) {
        }

        @RandomDouble(name = "blah") @RandomDouble(name = "blah")
        void passesName_asSecondParam(double param, String name) {
            assertEquals("blah", name);
        }

        @RandomDouble(min = 2, max = 10) @RandomDouble(min = 2, max = 10)
        void nameIsGeneric_byDefault(double value, String name) {
            assertEquals("double from 2.0 to 10.0", name);
        }
    }

    @Nested class AlphanumericGenerator {
        @Alphanumeric void generatesStringWithCorrectSymbols(String value) {
            assertEquals(value.getBytes().length, value.length());<commit_msg>Rename the tests to be more BDD-like<commit_after>package io.qala.datagen.junit5;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;

import static io.qala.datagen.RandomShortApi.english;
import static io.qala.datagen.RandomShortApi.numeric;
import static org.junit.jupiter.api.Assertions.*;
@SuppressWarnings("unused"/*some tests just check that the method param doesn't break anything but don't use it*/)
@DisplayName("JUnit5 Parameterized")
class Junit5ParameterizedTest {
    @Nested class IntGenerator {
        @RandomInt(min = 1, max = 10)
        void generatesIntInBoundaries(int param) {
            assertTrue(param <= 10);
            assertTrue(param >= 1);
        }

        @RandomInt @RandomInt
        void generatesAnyNumberByDefault(int param) {
            assertChangedFromLastTime(param);
        }

        @RandomInt(name = "zero")
        void ignoresName_if2ndParamIsNotPresent(int param) {
        }

        @RandomInt(name = "blah")
        void passesName_asSecondParam(int param, String name) {
            assertEquals("blah", name);
        }
    }
    @Nested class IntsGenerator {
        @RandomInt(min = 1, name = "greater than zero")
        @RandomInt(max = -1, name = "less than zero")
        void canGenerateMultipleInts(int param) {
            assertNotEquals(0, param);
            assertChangedFromLastTime(param);
        }

        @RandomInt(name = "zero") @RandomInt
        void ignoresName_if2ndParamIsNotPresent(int param) {
        }

        @RandomInt(name = "blah") @RandomInt(name = "blah")
        void passesName_asSecondParam(int param, String name) {
            assertEquals("blah", name);
        }

        @RandomInt(min = 2, max = 10) @RandomInt(min = 2, max = 10)
        void nameIsGeneric_byDefault(int value, String name) {
            assertEquals("int from 2 to 10", name);
        }
    }

    @Nested class LongGenerator {
        @RandomLong(min = 1, max = 10)
        void generatesIntInBoundaries(long param) {
            assertTrue(param <= 10);
            assertTrue(param >= 1);
        }

        @RandomLong @RandomLong @SuppressWarnings("ConstantConditions")
        void generatesAnyNumberByDefault(long param) {
            assertTrue(param >= Long.MIN_VALUE);
            assertTrue(param <= Long.MAX_VALUE);
            assertChangedFromLastTime(param);
        }

        @RandomLong(name = "zero")
        void ignoresName_if2ndParamIsNotPresent(long param) {
        }

        @RandomLong(name = "blah")
        void passesName_asSecondParam(long param, String name) {
            assertEquals("blah", name);
        }
    }
    @Nested class LongsGenerator {
        @RandomLong(min = 1, name = "greater than zero")
        @RandomLong(max = -1, name = "less than zero")
        void canGenerateMultipleNumbers(long param) {
            assertNotEquals(0, param);
            assertChangedFromLastTime(param);
        }

        @RandomLong(name = "zero") @RandomLong
        void ignoresName_if2ndParamIsNotPresent(long param) {
        }

        @RandomLong(name = "blah") @RandomLong(name = "blah")
        void passesName_asSecondParam(long param, String name) {
            assertEquals("blah", name);
        }

        @RandomLong(min = 2, max = 10) @RandomLong(min = 2, max = 10)
        void nameIsGeneric_byDefault(long value, String name) {
            assertEquals("long from 2 to 10", name);
        }
    }

    @Nested class DoubleGenerator {
        @RandomDouble(min = 1, max = 10)
        void generatesIntInBoundaries(double param) {
            assertTrue(param <= 10);
            assertTrue(param >= 1);
        }

        @RandomDouble @RandomDouble @SuppressWarnings("ConstantConditions")
        void generatesAnyNumberByDefault(double param) {
            assertTrue(param >= Long.MIN_VALUE);
            assertTrue(param <= Long.MAX_VALUE);
            assertChangedFromLastTime(param);
        }

        @RandomDouble(name = "zero")
        void ignoresName_if2ndParamIsNotPresent(double param) {
        }

        @RandomDouble(name = "blah")
        void passesName_asSecondParam(double param, String name) {
            assertEquals("blah", name);
        }
    }
    @Nested class DoublesGenerator {
        @RandomDouble(min = 1, name = "greater than zero")
        @RandomDouble(max = -1, name = "less than zero")
        void canGenerateMultipleNumbers(double param) {
            assertNotEquals(0, param);
            assertChangedFromLastTime(param);
        }

        @RandomDouble(name = "zero") @RandomDouble
        void ignoresName_if2ndParamIsNotPresent(double param) {
        }

        @RandomDouble(name = "blah") @RandomDouble(name = "blah")
        void passesName_asSecondParam(double param, String name) {
            assertEquals("blah", name);
        }

        @RandomDouble(min = 2, max = 10) @RandomDouble(min = 2, max = 10)
        void nameIsGeneric_byDefault(double value, String name) {
            assertEquals("double from 2.0 to 10.0", name);
        }
    }

    @Nested class AlphanumericGenerator {
        @Alphanumeric void generatesStringWithCorrectSymbols(String value) {
            assertEquals(value.getBytes().length, value.length());
{'fraction_non_alphanumeric': 0.10382251248559354, 'fraction_numerical': 0.012389550518632348, 'mean_word_length': 2.443452380952381, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4231954', 'n_tokens_mistral': 3031, 'n_tokens_neox': 2902, 'n_words': 653}