summaryrefslogtreecommitdiff
path: root/caching-tests
diff options
context:
space:
mode:
Diffstat (limited to 'caching-tests')
-rw-r--r--caching-tests/test.ur17
1 files changed, 14 insertions, 3 deletions
diff --git a/caching-tests/test.ur b/caching-tests/test.ur
index 8035e336..842fd77d 100644
--- a/caching-tests/test.ur
+++ b/caching-tests/test.ur
@@ -16,13 +16,24 @@ fun flush id =
FROM tab
WHERE tab.Id = {[id]});
(case res of
- None => dml (INSERT INTO tab (Id, Val)
- VALUES ({[id]}, 0))
+ None => return () (* dml (INSERT INTO tab (Id, Val) *)
+ (* VALUES ({[id]}, 0)) *)
| Some row => dml (UPDATE tab
SET Val = {[row.Tab.Val + 1]}
- WHERE Id = {[id]}));
+ WHERE Id = {[id + 1]} OR Id = {[id]} (* OR Id = {[id - 1]} *)));
return <xml><body>
{case res of
None => <xml>Initialized {[id]}!</xml>
| Some row => <xml>Incremented {[id]}!</xml>}
</body></xml>
+
+(* task periodic 5 = *)
+(* fn () => *)
+(* t <- now; *)
+(* let *)
+(* val n = toSeconds t % 2 *)
+(* in *)
+(* dml (UPDATE tab *)
+(* SET Val = 9001 *)
+(* WHERE Id = {[n]} OR Id = {[n+1]}) *)
+(* end *)