Skip to content

Commit df4642e

Browse files
Mikah-Kainenmichaelborkowski
authored andcommitted
Update CI tests to include coverage for fixes
Professor Borkowski fixed these issues: - Merge sort works on all backends - Quick sort works on all backends - The property test that swap is commutative now passes Remaining known issues with mutable backends: - splitMid returns arrays with changed elements - Swapping an index with itself changes the element at that index - makeArray doesn’t initialize elements to the proper value
1 parent 7912477 commit df4642e

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

lh-array-sort.cabal

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ test-suite test
140140
if flag(prim-mutable-arrays)
141141
cpp-options: -DPRIM_MUTABLE_ARRAYS -DMUTABLE_ARRAYS
142142

143+
if flag(runtime-checks)
144+
cpp-options: -DRUNTIME_CHECKS
145+
143146
default-language:
144147
Haskell2010
145148
type:

tests/ArrayTests.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,7 @@ testSwap = testGroup "Swap Tests" [ caseTests, performanceTests, propertyTests ]
304304
-- The property tests for the split function.
305305
propertyTests :: TestTree
306306
propertyTests = testGroup "Swap Property Tests" [
307-
-- TODO: the below should work for mutable backends too
308-
#ifndef MUTABLE_ARRAYS
309307
testSwapCommutative
310-
#endif
311308
] where
312309

313310
-- Generates random arrays to test that swap is commutative.

tests/SortTests.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,9 @@ sortTests = testGroup "Sorting Tests" [
5959
testWorkingSorts :: TestTree
6060
testWorkingSorts = testGroup "Test Working Sorts" [
6161
testSort "Insertion Sort" isort_top'
62-
-- TODO: these should be fixed eventually; but first look at the TODOs in ArrayTests...
63-
#ifndef MUTABLE_ARRAYS
6462
, testSort "Quick Sort" quickSort
65-
#endif
66-
#ifndef PRIM_MUTABLE_ARRAYS
6763
, testSort "Dps Merge Sort 4" M4.msort
6864
, testSort "Dps Merge Sort 4 Par" M4Par.msort
69-
#endif
7065
, testSort "Piecewise Fallback Sort" PF.pfsort
7166
, testSort "Piecewise Fallback Sort Par" PFPar.pfsort
7267
] where

0 commit comments

Comments
 (0)