<commit_before>package org.spekframework.spek2.data_driven

import org.spekframework.spek2.Spek
import kotlin.test.assertEquals

class DataDrivenSpec : Spek({

    given("a calculator") {

        val calculator = Calculator()

        val data = arrayOf(
            data(4, 2, expected = 6),
            data(1, 3, expected = 4),
            data(5, 7, expected = 12)
        )

        on("addition %s and %s", with = *data) { input1, input2, expected ->

            it("returns $expected") {
                assertEquals(expected, calculator.add(input1, input2))
            }
        }

        on("%s subtract %s and subtract %s",
            data(10, 5, 3, expected = 2),
            data(100, 50, 8, expected = 42),
            data(0, 5, 3, expected = -8)
        ) { minuend, subtrahend1, subtrahend2, expected ->

            it("returns $expected") {
                assertEquals(calculator.subtract(calculator.subtract(minuend, subtrahend1), subtrahend2), expected)
            }
        }

        on("%s divided by %s", with = data(10, 2, expected = 5)) { dividend, divisor, result ->

            it("returns $result") {
                assertEquals(calculator.divide(dividend, divisor), result)
            }
        }
    }
})<commit_msg>Fix assigning single element to named vararg parameter. (#310)<commit_after>package org.spekframework.spek2.data_driven

import org.spekframework.spek2.Spek
import kotlin.test.assertEquals

class DataDrivenSpec : Spek({

    given("a calculator") {

        val calculator = Calculator()

        val data = arrayOf(
            data(4, 2, expected = 6),
            data(1, 3, expected = 4),
            data(5, 7, expected = 12)
        )

        on("addition %s and %s", with = *data) { input1, input2, expected ->

            it("returns $expected") {
                assertEquals(expected, calculator.add(input1, input2))
            }
        }

        on("%s subtract %s and subtract %s",
            data(10, 5, 3, expected = 2),
            data(100, 50, 8, expected = 42),
            data(0, 5, 3, expected = -8)
        ) { minuend, subtrahend1, subtrahend2, expected ->

            it("returns $expected") {
                assertEquals(calculator.subtract(calculator.subtract(minuend, subtrahend1), subtrahend2), expected)
            }
        }

        on("%s divided by %s", data(10, 2, expected = 5)) { dividend, divisor, result ->

            it("returns $result") {
                assertEquals(calculator.divide(dividend, divisor), result)
            }
        }
    }
})
{'fraction_non_alphanumeric': 0.12715179968701096, 'fraction_numerical': 0.03325508607198748, 'mean_word_length': 1.9526558891454966, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '265081', 'n_tokens_mistral': 843, 'n_tokens_neox': 743, 'n_words': 189}