summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-04-06 12:04:08 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-04-06 12:04:08 -0400
commit0f74117c0c60e4fe07487a36fa0c665a6f359ce1 (patch)
tree0b6205da39756b18267509a86ec20634760d95bd /tests
parent61a066e4521ced56344f0f554584f5cf92dd68ea (diff)
Parsing more comparison operators
Diffstat (limited to 'tests')
-rw-r--r--tests/policy.ur13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/policy.ur b/tests/policy.ur
index 6f2d2d5b..40850393 100644
--- a/tests/policy.ur
+++ b/tests/policy.ur
@@ -13,7 +13,7 @@ policy query_policy (SELECT fruit.Id, fruit.Nam
FROM fruit)
(* The weight is sensitive information; you must know the secret. *)
-policy query_policy (SELECT fruit.Weight
+policy query_policy (SELECT fruit.Weight, fruit.Secret
FROM fruit
WHERE known(fruit.Secret))
@@ -26,7 +26,12 @@ fun fname r =
x <- queryX (SELECT fruit.Weight
FROM fruit
WHERE fruit.Nam = {[r.Nam]}
- AND fruit.Secret = {[r.Secret]})
+ AND fruit.Secret = {[r.Secret]}
+ AND fruit.Weight <> 3.14
+ AND fruit.Weight < 100.0
+ AND fruit.Weight <= 200.1
+ AND fruit.Weight > 1.23
+ AND fruit.Weight >= 1.24)
(fn r => <xml>Weight is {[r.Fruit.Weight]}</xml>);
return <xml><body>
@@ -36,8 +41,7 @@ fun fname r =
fun main () =
x1 <- queryX (SELECT fruit.Id, fruit.Nam
FROM fruit
- WHERE fruit.Nam = "apple"
- AND fruit.Weight = 1.23)
+ WHERE fruit.Nam = "apple")
(fn x => <xml><li>{[x.Fruit.Id]}: {[x.Fruit.Nam]}</li></xml>);
x2 <- queryX (SELECT fruit.Nam, order.Qty
@@ -48,6 +52,7 @@ fun main () =
return <xml><body>
<ul>{x1}</ul>
+
<ul>{x2}</ul>
<form>