-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change structure of examples, tests, bench, and tests-examples to pro…
…perly match src structure
- Loading branch information
Showing
17 changed files
with
48 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
bench/Data/Mutable/Quicksort.hs → bench/Bench/Data/Array/Mutable/Quicksort.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
module Main where | ||
|
||
import qualified Data.Mutable.Array as Array | ||
import qualified Data.Mutable.HashMap as HashMap | ||
import qualified Data.Mutable.Quicksort as Quicksort | ||
import qualified Bench.Data.Array.Mutable as Array | ||
import qualified Bench.Data.Array.Mutable.Quicksort as Quicksort | ||
import qualified Bench.Data.HashMap.Mutable as HashMap | ||
import Test.Tasty.Bench (defaultMain) | ||
|
||
main :: IO () | ||
main = do | ||
defaultMain | ||
[ Array.benchmarks, | ||
HashMap.benchmarks, | ||
Quicksort.benchmarks | ||
Quicksort.benchmarks, | ||
HashMap.benchmarks | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# Examples | ||
|
||
* `Data` | ||
* These are examples of using the pure linear interface of mutable | ||
data structures provided by linear base. | ||
* `Simple` | ||
* These are tutorial level examples for understanding linear | ||
types and using bread-and-butter tools in linear base. | ||
* Recommended order: `Pure`, `FileIO`. | ||
* `Foreign` | ||
* These are examples of explicitly allocating off the GC heap's | ||
memory and on the system heap's memory | ||
|
||
memory and on the system heap's memory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
test-examples/Test/Simple/Quicksort.hs → ...ples/Test/Data/Array/Mutable/Quicksort.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Test.Simple.Quicksort (quicksortTests) where | ||
module Test.Data.Array.Mutable.Quicksort (quicksortTests) where | ||
|
||
import Data.Array.Mutable.Quicksort (quicksortUsingArray, quicksortUsingList) | ||
import Data.List (sort) | ||
import Hedgehog | ||
import qualified Hedgehog.Gen as Gen | ||
import qualified Hedgehog.Range as Range | ||
import Simple.Quicksort (quicksortUsingArray, quicksortUsingList) | ||
import Test.Tasty | ||
import Test.Tasty.Hedgehog (testPropertyNamed) | ||
|
||
quicksortTests :: TestTree | ||
quicksortTests = | ||
testGroup | ||
"quicksort tests" | ||
[ testPropertyNamed "sort xs === quicksortUsingArray xs" "testQuicksortUsingArray" testQuicksortUsingArray, | ||
testPropertyNamed "sort xs === quicksortUsingList xs" "testQuicksortUsingList" testQuicksortUsingList | ||
[ testPropertyNamed "sort xs === quicksortUsingArray xs" "testQsortUsingArray" testQsortUsingArray, | ||
testPropertyNamed "sort xs === quicksortUsingList xs" "testQsortUsingList" testQsortUsingList | ||
] | ||
|
||
testQuicksortUsingArray :: Property | ||
testQuicksortUsingArray = property $ do | ||
testQsortUsingArray :: Property | ||
testQsortUsingArray = property $ do | ||
xs <- forAll $ Gen.list (Range.linear 0 1000) (Gen.int $ Range.linear 0 100) | ||
sort xs === quicksortUsingArray xs | ||
|
||
testQuicksortUsingList :: Property | ||
testQuicksortUsingList = property $ do | ||
testQsortUsingList :: Property | ||
testQsortUsingList = property $ do | ||
xs <- forAll $ Gen.list (Range.linear 0 1000) (Gen.int $ Range.linear 0 100) | ||
sort xs === quicksortUsingList xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/Test/Data/Destination.hs → test/Test/Data/Array/Destination.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/Test/Data/Polarized.hs → test/Test/Data/Array/Polarized.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters