Skip to content

Commit 0a80b68

Browse files
committed
Prepare article for publication
1 parent 7f2a3f6 commit 0a80b68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/2025-06-24-composing-pure-haskell-assertions.html renamed to _posts/2025-09-29-composing-pure-haskell-assertions.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "Composing pure Haskell assertions"
44
description: "With HUnit and QuickCheck examples."
5-
date: 2025-06-24 11:22 UTC
5+
date: 2025-09-29 7:43 UTC
66
tags: [Haskell, Unit Testing]
77
---
88
{% include JB/setup %}
@@ -47,7 +47,7 @@ <h3 id="76d1bda9793e4f5c810f387c09fc8324">
4747
&nbsp;&nbsp;expectedSizes&nbsp;@=?&nbsp;actualSizes</pre>
4848
</p>
4949
<p>
50-
This example is an <a href="/2018/05/07/inlined-hunit-test-lists">inlined HUnit test</a> which tests the <a href="" title="IO is special">impure cutRod variation</a>. The two final statements are assertions that use the <a href="https://hackage.haskell.org/package/HUnit/docs/Test-HUnit-Base.html#v:-64--61--63-">@=?</a> assertion operator. The value on the left side is the expected value, and to the right goes the actual value. This operator returns a type called <code>Assertion</code>, which <a href="https://hackage.haskell.org/package/HUnit/docs/Test-HUnit-Base.html#t:Assertion">turns out</a> to be nothing but an alias for <code>IO ()</code>.
50+
This example is an <a href="/2018/05/07/inlined-hunit-test-lists">inlined HUnit test</a> which tests the <a href="/2025/09/08/io-is-special">impure cutRod variation</a>. The two final statements are assertions that use the <a href="https://hackage.haskell.org/package/HUnit/docs/Test-HUnit-Base.html#v:-64--61--63-">@=?</a> assertion operator. The value on the left side is the expected value, and to the right goes the actual value. This operator returns a type called <code>Assertion</code>, which <a href="https://hackage.haskell.org/package/HUnit/docs/Test-HUnit-Base.html#t:Assertion">turns out</a> to be nothing but an alias for <code>IO ()</code>.
5151
</p>
5252
<p>
5353
In other words, those assertions are impure actions, and they work similarly to assertions in imperative languages. If the actual value passes the assertion, nothing happens and execution moves on to the assertion on the next line. If, on the other hand, the assertion fails, execution short-circuits, and an error is reported.

0 commit comments

Comments
 (0)