From bc21ec8437a0032744f14ef073e3c01dc0d20188 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 24 Jul 2012 00:31:29 -0400
Subject: [PATCH] Specify post-condition on scan usage example.

---
 doc/source/array.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/source/array.rst b/doc/source/array.rst
index 4d66fe07..a7df8eeb 100644
--- a/doc/source/array.rst
+++ b/doc/source/array.rst
@@ -688,6 +688,11 @@ greater than 300::
     out = a.copy()
     knl(a, out)
 
+    a_host = a.get()
+    out_host = a[a > 300]
+
+    assert (out_host == out.get()[:len(out_host)]).all()
+
 The value being scanned over is a number of flags indicating whether each array
 element is greater than 300. These flags are computed by *input_expr*. The
 prefix sum over this array gives a running count of array items greater than
-- 
GitLab