souplesse

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6b6c1d487e3c2942cc8b323e1be7b8978879aa87
parent 5ec65cc49b80857e65870a43fb94a00a8b358025
Author: Daniel Barlow <dan@telent.net>
Date:   Tue, 29 Oct 2024 19:20:08 +0000

update test1 to work with Either

Diffstat:
Mtests/UnitTest.hs | 17+++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/tests/UnitTest.hs b/tests/UnitTest.hs @@ -7,15 +7,12 @@ import Control.Exception import Debug.Trace (trace, traceShow) --- test1 :: Test --- test1 = TestCase $ --- let --- trk = Track.parse "<gpx></gpx>" --- in --- assertEqual "empty track has no elements" --- 0 (Track.length trk) - -test3 = TestCase $ assertEqual "empty track has no elements" 1 2 +test1 :: Test +test1 = TestCase $ + case Track.parse "<gpx></gpx>" of + Left err -> assertFailure (displayException err) + Right t -> assertEqual "empty track has no elements" + 0 (Track.length t) test2 = TestCase $ case Track.parse @@ -30,7 +27,7 @@ test2 = TestCase $ tests :: Test tests = TestList [ --- TestLabel "test1" test1, + TestLabel "test1" test1, TestLabel "test2" test2 ]