summaryrefslogtreecommitdiff
path: root/Biz/Test.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-08-04 11:09:35 -0400
committerBen Sima <ben@bsima.me>2021-11-26 13:47:37 -0500
commit9b1df01fd2cf3ecf41fc68b94051db665821c774 (patch)
treec1a3e68f625679576ff7e47bd1ebcb07bb94e15e /Biz/Test.hs
parent0264f4a5dc37b16f872e6fa92bd8f1fc1e2b1826 (diff)
Reimplement Que with Servant
Still todo: add authentication. But that can wait. In re-implementing this, I was able to figure out how to get the Go.mult working properly as well. The problem is that a tap from a mult channel does not remove the message from the original channel. I'm not sure if that should be a core feature or not; for now I'm just draining the channel when it's received in the Que HTTP handler. (Also, this would be a good place to put persistence: have a background job read from the original channel, and write the msg to disk via acid-state; this would obviate the need for a flush to nowhere.) Also, streaming is working now. The problem was that Scotty closes the connection after it sees a newline in the body, or something, so streaming over Scotty doesn't actually work. It's fine, Servant is better anyway.
Diffstat (limited to 'Biz/Test.hs')
-rw-r--r--Biz/Test.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Biz/Test.hs b/Biz/Test.hs
index bd1384e..31a8831 100644
--- a/Biz/Test.hs
+++ b/Biz/Test.hs
@@ -74,6 +74,7 @@ assertNotEqual preface notexpected actual =
++ "\n but got: "
++ show actual
+-- | unexpectedValue @?!= actual
(@?!=) ::
(Eq a, Show a, HasCallStack) =>
-- | The not-expected value
@@ -85,11 +86,13 @@ expected @?!= actual = assertNotEqual "" expected actual
infixl 2 @?!=
+-- |
(@=?) :: (Eq a, Show a) => a -> a -> HUnit.Assertion
a @=? b = a HUnit.@=? b
infixl 2 @=?
+-- |
(@?=) :: (Eq a, Show a) => a -> a -> HUnit.Assertion
a @?= b = a HUnit.@?= b