From 80247032c82af8d87fccd5e1837eb7cdb1eb127e Mon Sep 17 00:00:00 2001 From: HuLpeK Date: Fri, 17 Dec 2021 16:35:31 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Zmiana=20pliku=20tworz=C4=85cego=20testy=20?= =?UTF-8?q?-=20powrot=20do=20wersji=20z=20commita=20c53c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests.pl b/tests.pl index fbaf4d2..1e91e8b 100644 --- a/tests.pl +++ b/tests.pl @@ -1,14 +1,14 @@ :- begin_tests(qs). :- use_module(library(lists)). -test(project_dedalus_quicksort,[nondet]) :- +test(quicksort,[nondet]) :- L = [4,5,1], - project_dedalus_quicksort(L, Sorted), + quicksort(L, Sorted), sort(L, Sorted). test(quicksort,[nondet]) :- - L=[8,4,2,1,3,6,5,7,12,10,9,11,14,13,15], - project_dedalus_quicksort(L, Sorted), + randseq(15,15,L), + quicksort(L, Sorted), sort(L, Sorted). :- end_tests(qs). From 52021c43b5d62b319dc5f7319d2e51bdc4b2e184 Mon Sep 17 00:00:00 2001 From: HuLpeK Date: Fri, 17 Dec 2021 16:38:19 +0100 Subject: [PATCH 2/3] Poprawa generowania testu --- quicksort.pl | 1 + tests.pl | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/quicksort.pl b/quicksort.pl index c18564e..23cfc84 100644 --- a/quicksort.pl +++ b/quicksort.pl @@ -1,6 +1,7 @@ % Implementacja Quicksorta w Prologu % Autor korpo, https://github.com/korpo + project_dedalus_quicksort([X],[X]). project_dedalus_quicksort([X|Xs],Ys) :- project_dedalus_quicksort_helper_partition(Xs,X,Left,Right), diff --git a/tests.pl b/tests.pl index 1e91e8b..b061879 100644 --- a/tests.pl +++ b/tests.pl @@ -1,14 +1,14 @@ :- begin_tests(qs). :- use_module(library(lists)). -test(quicksort,[nondet]) :- +test(project_dedalus_quicksort,[nondet]) :- L = [4,5,1], - quicksort(L, Sorted), +project_dedalus_quicksort(L, Sorted), sort(L, Sorted). -test(quicksort,[nondet]) :- +test(project_dedalus_quicksort,[nondet]) :- randseq(15,15,L), - quicksort(L, Sorted), +project_dedalus_quicksort(L, Sorted), sort(L, Sorted). :- end_tests(qs). From afb26f46aa0d1584b8888b3bd056c3014a32f053 Mon Sep 17 00:00:00 2001 From: HuLpeK Date: Fri, 17 Dec 2021 16:40:46 +0100 Subject: [PATCH 3/3] Naprawa quicksorta --- quicksort.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quicksort.pl b/quicksort.pl index 23cfc84..1ed30fe 100644 --- a/quicksort.pl +++ b/quicksort.pl @@ -1,7 +1,7 @@ % Implementacja Quicksorta w Prologu % Autor korpo, https://github.com/korpo - +project_dedalus_quicksort([],[]). project_dedalus_quicksort([X],[X]). project_dedalus_quicksort([X|Xs],Ys) :- project_dedalus_quicksort_helper_partition(Xs,X,Left,Right),