Questions tagged [tasty]
10 questions
2
votes
1 answer
Using Warp's `testWithApplication` from Tasty
Tasty has only the function withResource to manage resources in your tests.
The function takes a resource initialization and cleanup function as arguments:
withResource :: IO a -> (a -> IO ()) -> TestTree -> TestTree
I'm trying to test a Servant…

fghibellini
- 636
- 4
- 15
1
vote
0 answers
Scala 3 quotes: get default case class field value
I've been trying to access the default value of a declared case class's field by trying various functions on the quote's Symbol API, but with no luck so far:
case class User(name: String = "Shayan")
given scala.quoted.staging.Compiler =…

shayan
- 1,211
- 9
- 12
1
vote
1 answer
Trouble including tasty-quickcheck in the build
I am new to stack.
I have a stack project that I want to use tasty-quickcheck. When I add tasty-quickcheck to package.yaml, stack asks me to add it to stack.yaml as well under extra-deps section. After adding tasty-quickcheck-0.10.1.1 to extra-deps…

Random dude
- 519
- 2
- 11
1
vote
0 answers
Haskell: how to test that assertion exceptions are raised by a lifted function, using Tasty & Hspec
I'm very much still a beginner at Haskell. I learn best by trying things out, but sometimes I feel like I'm missing something fundamental. This is one of those times.
I have some code that calls Control.Exception.assert but the Assertion exception…

davidA
- 12,528
- 9
- 64
- 96
1
vote
2 answers
Haskell Tasty Unit Tests - how to use groups and simple fixtures to avoid repetition?
How would you go about writing a Tasty HUnit test that incorporates multiple checks against a single fixture variable in a single test, or at least a tidy group of such tests?
For example, consider this Gherkin specification:
Scenario: A 3-Vector…

davidA
- 12,528
- 9
- 64
- 96
0
votes
0 answers
How to emulate post-mortem debugging mode in HSpec/Tasty
Haskell debugger does support post-mortem debugging (setting breakpoints on raised exception).
So it should be possible to drop into debugger on testing failtures, as pytest --pdb does it.
In principle you should load test runner in ghci/ghcid with…

uhbif19
- 3,139
- 3
- 26
- 48
0
votes
1 answer
not load data from api in rapidapi flutter App
i need to load the data to my application
when i retrive from this link https://jsonplaceholder.typicode.com/albums its work
but when i use rapid api not load data
the problem is in the connection to the server or not
** the code file here …

Alaa Abdullah
- 1
- 2
0
votes
0 answers
How do I install and run Test.Tasty.Patterns
I want to use the following for testing the ReadP Monad Parser.
https://hackage.haskell.org/package/tasty-1.4.3/docs/Test-Tasty-Patterns-Parser.html . How can I install it correctly?
When trying to import
I get
Test.hs:7:1: error:
Could not load…

Piskator
- 605
- 1
- 9
0
votes
2 answers
How to extract all methods in scala 3 using a tasty inspector?
I am trying to use a tasty inspector to convert method params to case classes but I get a classcast exception at runtime.
My code:
import dotty.tools.dotc.ast.Trees.{PackageDef, Template}
import scala.quoted.*
import scala.tasty.inspector.*
class…

kostas.kougios
- 945
- 10
- 21
0
votes
1 answer
How can Tasty withResource have a bench?
https://hackage.haskell.org/package/tasty-bench-0.3.2/docs/Test-Tasty-Bench.html#v:env
I am actually trying to use withResource, but have not gotten env to work either. I can not figure out how to embed bench inside of withResource.
This is what I…

thirsty
- 73
- 6