souplesse/tests/TrackTest.elm
Daniel Barlow 7b8e07d3ba check we read all <trkseg> not just the first
.. it turns out that elm-xml-decode does this already
2024-10-24 17:59:59 +01:00

29 lines
908 B
Elm

module TrackTest exposing (specs)
import Fixtures
import Track exposing (Track, Point)
import Test exposing (..)
import Expect exposing (Expectation)
specs: Test
specs =
describe "XML Parsing"
[ test "it parses points" <|
\_ ->
case Track.parse Fixtures.threepoints of
(Ok trk) -> Expect.equalLists Fixtures.threepoints_expected trk
_ -> Expect.fail "not ok"
, test "multiple trksegs are coalesced" <|
\_ ->
let
xml = String.replace
"<!-- insert-segment -->"
"</trkseg><trkseg>"
Fixtures.threepoints
in
case Track.parse xml of
(Ok trk) -> Expect.equalLists Fixtures.threepoints_expected trk
_ -> Expect.fail "not ok"
]