summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-08-19 14:20:24 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-08-19 14:20:24 -0400
commit2babe3938c1d97e46be24e033d9cb575f746d80b (patch)
tree171d4a50ae25c43824224d1cf7bf418b16de314c /tests
parentafaf7f27220ccc94b3bb29fb14994040e97b1f4e (diff)
Add antiquote for ORDER BY directions
Diffstat (limited to 'tests')
-rw-r--r--tests/ascdesc.ur10
-rw-r--r--tests/ascdesc.urp4
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/ascdesc.ur b/tests/ascdesc.ur
new file mode 100644
index 00000000..59dd0169
--- /dev/null
+++ b/tests/ascdesc.ur
@@ -0,0 +1,10 @@
+table t : { A : int }
+
+fun sortEm b =
+ queryX1 (SELECT * FROM t ORDER BY t.A {if b then sql_asc else sql_desc})
+ (fn r => <xml>{[r.A]}; </xml>)
+
+fun main () : transaction page = return <xml><body>
+ <a link={sortEm True}>Ascending</a><br/>
+ <a link={sortEm False}>Descending</a>
+</body></xml>
diff --git a/tests/ascdesc.urp b/tests/ascdesc.urp
new file mode 100644
index 00000000..3e0b075d
--- /dev/null
+++ b/tests/ascdesc.urp
@@ -0,0 +1,4 @@
+database dbname=test
+sql ascdesc.sql
+
+ascdesc \ No newline at end of file