summaryrefslogtreecommitdiff
path: root/caching-tests
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-06-28 12:46:51 -0700
committerGravatar Ziv Scully <ziv@mit.edu>2015-06-28 12:46:51 -0700
commit24edb607ef64db1ab12b3d5b9ccd3848c50780d1 (patch)
tree933a65e83f09da4b6d061a0bc2335cebb087d70d /caching-tests
parentca3efa1458583772a9826198ed4b99eec381f2de (diff)
Progress on LRU cache but still more known bugs to fix.
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 *)