@@ -1,7 +1,6 @@
11module Test.Main where
22
3−import Prelude (Unit, ($), (==), mempty, unit, pure, bind, const)
4−import Control.Bind ((>=>))
3+import Prelude (Unit, ($), (==), unit, pure, bind, const)
54import Control.Apply ((*>))
65import Control.Monad.Error.Class (class MonadThrow, throwError, liftMaybe)
76import Effect
@@ -12,7 +11,6 @@ import HTTPure.Request (Request)
1211import HTTPure.Response (ok)
1312import HTTPure.Server (serve)
1413import HTTPure.Body (class Body)
15−import HTTPure.Path (read)
1614import HTTPure.Lookup ((!!))
1715import Test.Unit (suite, test)
1816import Test.Unit.Main (runTest)
@@ -23,8 +21,8 @@ validateReq :: forall m. MonadThrow Error m => Request -> m Unit
2321validateReq req = do
2422 let invalidPath = error "invalid path"
2523 missingPath = error "missing path"
26− p <- liftMaybe missingPath $ read req !! 0
27− case p == "/compile" of
24+ p <- liftMaybe missingPath $ req.path !! 0
25+ case p == "compile" of
2826 true -> pure unit
2927 false -> throwError invalidPath
3028
@@ -42,4 +40,4 @@ main = runTest do
4240 test "produces expected output" do
4341 let expected = "2"
4442 actual <- setupSrv expected (compile "1+1")
45− actual `equal` expected
43+ expected `equal` actual