<commit_before>package com.tngtech.test.junit.dataprovider;

import static com.tngtech.junit.dataprovider.DataProviders.$;
import static com.tngtech.junit.dataprovider.DataProviders.$$;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;

import com.tngtech.junit.dataprovider.DataProvider;
import com.tngtech.junit.dataprovider.UseDataProvider;
import com.tngtech.junit.dataprovider.UseDataProviderExtension;

@TestInstance(Lifecycle.PER_CLASS)
@ExtendWith(UseDataProviderExtension.class)
class NonStaticDataProviderAcceptanceTest {

    @DataProvider
    Object[][] dataProviderDivide() {
        // @formatter:off
        return $$(
                $(  0,   1,  0 ),
                $(  0,  -1,  0 ),
                $(  1,  1,   1 ),
                $(  1, -1,  -1 ),
                $(  2,  1,   2 )
        );
        // @formatter:on
    }

    @TestTemplate
    @UseDataProvider
    void testDivide(int a, int b, int expected) {
        // Given:

        // When:
        int result = a / b;

        // Then:
        assertThat(result).isEqualTo(expected);
    }
}
<commit_msg>add integration test for nested dataprovider<commit_after>package com.tngtech.test.junit.dataprovider;

import static com.tngtech.junit.dataprovider.DataProviders.$;
import static com.tngtech.junit.dataprovider.DataProviders.$$;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;

import com.tngtech.junit.dataprovider.DataProvider;
import com.tngtech.junit.dataprovider.UseDataProvider;
import com.tngtech.junit.dataprovider.UseDataProviderExtension;

@TestInstance(Lifecycle.PER_CLASS)
@ExtendWith(UseDataProviderExtension.class)
class NonStaticDataProviderAcceptanceTest {

    @DataProvider
    Object[][] dataProviderDivide() {
        // @formatter:off
        return $$(
                $(  0,   1,  0 ),
                $(  0,  -1,  0 ),
                $(  1,  1,   1 ),
                $(  1, -1,  -1 ),
                $(  2,  1,   2 )
        );
        // @formatter:on
    }

    @TestTemplate
    @UseDataProvider
    void testDivide(int a, int b, int expected) {
        // Given:

        // When:
        int result = a / b;

        // Then:
        assertThat(result).isEqualTo(expected);
    }

    @TestInstance(Lifecycle.PER_CLASS)
    @Nested
    class NestedTests {

        @DataProvider
        Object[][] dataProviderPow() {
            // @formatter:off
            return $$(
                    $( 0,  0 ),
                    $( 1,  1 ),
                    $( 2,  4 ),
                    $( 4, 16 )
            );
            // @formatter:on
        }

        @TestTemplate
        @UseDataProvider
        void testPow(int a, int expected) {
            // Given:

            // When:
            int result = a * a;

            // Then:
            assertThat(result).isEqualTo(expected);
        }
    }
}

{'fraction_non_alphanumeric': 0.11941212492345377, 'fraction_numerical': 0.011941212492345376, 'mean_word_length': 2.041899441340782, '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': '4050579', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1010, 'n_words': 174}