Can't run effectful tests

Offen
#102 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Bereich
testing

Rechercherichtung

Read the Test/QuickCheck.purs definition linked in the issue, especially the Gen-based property API. The report asks to support testing effectful functions without unsafePerformEffect; use the Blockly code2blockly then blockly2code round trip as the example. Done means an effectful property can express that round trip and verify the original code is returned.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

status: needs more info

I have a case that I think is quite legitimate where I want to quickcheck an effectful function however I can't because https://github.com/purescript/purescript-quickcheck/blob/v5.0.0/src/Test/QuickCheck.purs#L97 uses the concrete Gen monad.

My usecase is testing Blockly code2blockly and blockly2code functions. Since Blockly is a very mutable javascript library, both code2blockly and blockly2code have Effect types. In order to test my implementation of these functions I can take some code and basically run code2blockly followed by blockly2code and I should get the original code back. Currently I'm doing this with unsafePerformEffect 😱 but since tests are actually Effects I don't think this is really necessary.

Vorherrschende Sprache
PureScript
Sterne
108
Forks
42
Ø Merge
2 T. 23 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus purescript/purescript-quickcheck

Alle Issues in purescript/purescript-quickcheck

Ähnliche Issues

Weitere Issues zu Testing & QA

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.