summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-07-27 11:42:30 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2010-07-27 11:42:30 -0400
commit3c916538bab39f1c6d4af649f3ee9b05448ecb30 (patch)
treeac0a856842e4510fe7e96bf06d222bf7c6004d74 /tests
parent2ed97b5268a73d4ff83ad776e5a6063f469f68fe (diff)
Initial version of equalKnown working for secret
Diffstat (limited to 'tests')
-rw-r--r--tests/equalKnown.ur24
-rw-r--r--tests/equalKnown.urp1
-rw-r--r--tests/equalKnown.urs1
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/equalKnown.ur b/tests/equalKnown.ur
new file mode 100644
index 00000000..4af32490
--- /dev/null
+++ b/tests/equalKnown.ur
@@ -0,0 +1,24 @@
+type fruit = int
+table fruit : { Id : fruit, Nam : string, Weight : float, Secret : string }
+ PRIMARY KEY Id,
+ CONSTRAINT Nam UNIQUE Nam
+
+policy sendClient (SELECT fruit.Id, fruit.Nam
+ FROM fruit)
+
+policy sendClient (SELECT fruit.Weight
+ FROM fruit
+ WHERE known(fruit.Secret))
+
+policy equalKnown[#Secret] fruit
+
+fun main () =
+ x1 <- queryX (SELECT fruit.Id, fruit.Nam, fruit.Weight
+ FROM fruit
+ WHERE fruit.Nam = "apple"
+ AND fruit.Secret = "tasty")
+ (fn x => <xml><li>{[x.Fruit.Id]}: {[x.Fruit.Nam]}, {[x.Fruit.Weight]}</li></xml>);
+
+ return <xml><body>
+ <ul>{x1}</ul>
+ </body></xml>
diff --git a/tests/equalKnown.urp b/tests/equalKnown.urp
new file mode 100644
index 00000000..380321fd
--- /dev/null
+++ b/tests/equalKnown.urp
@@ -0,0 +1 @@
+equalKnown
diff --git a/tests/equalKnown.urs b/tests/equalKnown.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/tests/equalKnown.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page