Questions tagged [htf]

The Haskell Test Framework lets you define unit tests, QuickCheck properties, and black box tests in an easy and convenient way.

The Haskell Test Framework (HTF for short) lets you define unit tests, QuickCheck properties, and black box tests in an easy and convenient way. HTF uses a custom preprocessor that collects test definitions automatically. Furthermore, the preprocessor allows HTF to report failing test cases with exact file name and line number information. Additionally, HTF tries to produce highly readable output for failing tests: for example, it colors and pretty prints expected and actual results and provides a diff between the two values.

10 questions
15
votes
1 answer

Testing with HTF

There's an incredible lack of decent documentation on HTF. All I could find was a Tutorial which doesn't provide any of the following really important information: How do I create a test suite that automatically executes all tests from…
Nikita Volkov
  • 42,792
  • 11
  • 94
  • 169
5
votes
3 answers

HTF does not test props generated by TH

I want to do a number of similar tests on various types in my library. To simplify things, assume I have a number of vector types implementing Num class, and I want to generate the same QuickCheck property check prop_absNorm x y = abs x + abs y >=…
artem
  • 363
  • 1
  • 9
4
votes
2 answers

Test.QuickCheck: speed up testing multiple properties for the same type

I am testing a random generator generating instances of my own type. For that I have a custom instance of Arbitrary: complexGenerator :: (RandomGen g) => g -> (MyType, g) instance Arbitrary MyType where arbitrary = liftM (fst . complexGenerator…
Koterpillar
  • 7,883
  • 2
  • 25
  • 41
4
votes
1 answer

Trouble Installing HTF with Cabal

I am trying to install HTF. However after I cabal install HTF I get this: Resolving dependencies... Configuring HTF-0.10.0.7... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a…
DJG
  • 6,413
  • 4
  • 30
  • 51
4
votes
1 answer

Haskell Test Framework (HTF) and test definitions in multiple modules

HTF has sample project which shows how to use test framework. Module MyPkg.A defines some tests and MyPkg.B defines some tests. Is it possible to write new module MyPkg.C which aggregates tests from modules A and B (and does not define new tests…
sergeyz
  • 1,308
  • 2
  • 14
  • 23
3
votes
1 answer

Weirdness with cabal, HTF, and HUnit assertions

So I'm trying to use HTF to run some HUnit-style assertions % cat tests/TestDemo.hs {-# OPTIONS_GHC -Wall -F -pgmF htfpp #-} module Main where import Test.Framework import Test.HUnit.Base ((@?=)) import System.Environment (getArgs) -- just run some…
rampion
  • 87,131
  • 49
  • 199
  • 315
2
votes
0 answers

Cabal testsuite - How can I pass a flag?

I use cabal with test-suites. The processor I use (HTF) allows flags (e.g. --quiet). How can I add such flags in the cabal file in order to be passed automatically to the test suite program when it is executed?
user855443
  • 2,596
  • 3
  • 25
  • 37
1
vote
2 answers

How to report failing test cases

I am using Haskell Test Framework through Stack to evaluate QuickCheck properties. When I run stack test, failing properties are reported in the form of Gave up! Passed only 95 tests. The many examples of property testing I've found report…
user7850864
1
vote
0 answers

Cannot install HTF on osx with cabal

I've seen this question regarding installing HTF and errors with cpphs, but it doesn't seem to apply. I did a 100% fresh haskell platform install on two seperate osx machines, and tried to do cabal install htf --global (after installing cpphs and…
devshorts
  • 8,572
  • 4
  • 50
  • 73
0
votes
0 answers

Pine Script during Back testing higher time frame indicator isn't drawn on screen

While doing back testing on daily time frame I wish to refer Weekly (HTF) macd line value. The default MACD indicator in tradingview doesn't show value nor does it plot macdline of higher HTF. So i wrote following code which shows the value but…
Pravin
  • 35
  • 4