Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- import org.junit.*;
- import org.junit.Test;
- import static org.junit.Assert.*;
- public class HeapSortTest {
- @Test
- public void testSort() throws Exception {
- System.out.println("sort");
- int[] arr = new int[10];
- Random r = new Random();
- for(int i = 0; i<arr.length; i++){
- arr[i] = r.nextInt(100);
- }
- HeapSort.sort(arr);
- for(int i = 0; i<arr.length-1;i++){
- if(arr[i] > arr[i+1]) throw new Exception();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement