From a782d8c1fa6f265644e6fb4c44250f43c0b36e19 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Tue, 17 Dec 2024 08:26:56 +0000 Subject: [PATCH] add sort test --- .../powersort/sort/AbstractSortTest.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/de/uni_marburg/powersort/sort/AbstractSortTest.java b/app/src/test/java/de/uni_marburg/powersort/sort/AbstractSortTest.java index b058a10..aba63c0 100644 --- a/app/src/test/java/de/uni_marburg/powersort/sort/AbstractSortTest.java +++ b/app/src/test/java/de/uni_marburg/powersort/sort/AbstractSortTest.java @@ -2,6 +2,7 @@ package de.uni_marburg.powersort.sort; import de.uni_marburg.powersort.JUnitUtil; import de.uni_marburg.powersort.data.AscendingRuns; +import de.uni_marburg.powersort.data.DescendingIntegers; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.converter.ConvertWith; import org.junit.jupiter.params.provider.CsvSource; @@ -17,9 +18,8 @@ public abstract class AbstractSortTest { @CsvSource({ "''", "1337", - "3|2|1", + "|2|3|1", "1|1", - "2|1", "2|1|2", }) void test1(@ConvertWith(JUnitUtil.IntegerArrayConverter.class) Integer[] array) { @@ -35,6 +35,17 @@ public abstract class AbstractSortTest { Integer[] array = AscendingRuns.newAscendingRuns(numOfRuns, runLength, decreaseBetweenRuns).getCopy(); sortAndCheckResult(array); } + @ParameterizedTest + @CsvSource({ + "2", + "3", + "13", + "1337", + }) + void test2(int size) { + Integer[] array = new DescendingIntegers(size).getCopy(); + sortAndCheckResult(array); + } void sortAndCheckResult(Integer[] array){ Integer[] expected = Arrays.copyOf(array, array.length);