Skip to content

MondayMorningHaskell/Testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing in Haskell

This repository accompanies the Testing Series on the Monday Morning Haskell blog. The series give a tutorial for a few different essential testing tools in Haskell, including HUnit, HSpec and Criterion. You can read the code in the articles and follow along with the examples here. There are a couple special "practice" modules where you can try out the examples for yourself. See FencesPractice.hs and FencesPracticeTests.hs, as referenced in part 3 of the series.

Repository Instructions

Start by building the code:

>> stack build

You can then run a series of test suites and benchmarks associated with the library:

>> stack build Testing:test:unit-test
>> stack build Testing:test:spec-test
>> stack build Testing:test:fences-tests
>> stack build Testing:bench:fences-benchmark
>> stack build Testing:test:fences-fast-tests
>> stack build Testing:bench:fences-fast-benchmark

You're also encouraged to try running the benchmarks with the --profile option. This will enable you to see the profiling output for better debugging.

>> stack build Testing:bench:fences-benchmark
>> stack build Testing:bench:fences-fast-benchmark

Note that when you switch between compiling any part of the project with --profile and without the option, Stack will need to recompile all modules and dependencies, which can be a length process.

Practice for Yourself

Part 3 of the series presents some data structure improvements we can make to an algorithm introduced in Part 2. You can try writing some of the code for that part yourself in this practice module. You are encouraged to use a "Test-Driven-Development" style and write your tests in this file. You can run this test suite like so:

>> stack build Testing:test:fences-practice-tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published