diff options
author | Adam Chlipala <adam@chlipala.net> | 2010-07-27 11:42:30 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2010-07-27 11:42:30 -0400 |
commit | 3c916538bab39f1c6d4af649f3ee9b05448ecb30 (patch) | |
tree | ac0a856842e4510fe7e96bf06d222bf7c6004d74 /tests | |
parent | 2ed97b5268a73d4ff83ad776e5a6063f469f68fe (diff) |
Initial version of equalKnown working for secret
Diffstat (limited to 'tests')
-rw-r--r-- | tests/equalKnown.ur | 24 | ||||
-rw-r--r-- | tests/equalKnown.urp | 1 | ||||
-rw-r--r-- | tests/equalKnown.urs | 1 |
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 |