summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-03-27 15:06:02 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-03-27 15:06:02 -0400
commit490acedef648f89dd9aa5a8b5462aff880d8d94b (patch)
treec742c07e6ddd4460130105032c7f15e4c5b4c27f /tests
parent1bb5bf1342b794a7918678922e7cef2ab388160a (diff)
Fix MySQL time handling
Diffstat (limited to 'tests')
-rw-r--r--tests/urblog.ur35
-rw-r--r--tests/urblog.urp4
-rw-r--r--tests/urblog.urs2
3 files changed, 41 insertions, 0 deletions
diff --git a/tests/urblog.ur b/tests/urblog.ur
new file mode 100644
index 00000000..9e3cc27f
--- /dev/null
+++ b/tests/urblog.ur
@@ -0,0 +1,35 @@
+table entry : { Id : int, Title : string, Created : time, Author : string,
+Body : string }
+ PRIMARY KEY Id
+
+fun list () =
+ rows <- queryX (SELECT * FROM entry)
+ (fn row =>
+ <xml>
+ <div>
+ <h1>{[row.Entry.Title]}</h1><br />
+ <h2>By {[row.Entry.Author]} at {[row.Entry.Created]}</h2>
+ <p>{[row.Entry.Body]}</p>
+ </div>
+ </xml>
+ );
+ return
+ <xml>
+ <head>
+ <title>All Entries</title>
+ </head>
+ <body>
+ <h1>All Entries</h1>
+ {rows}
+ </body>
+ </xml>
+
+fun main () = return <xml>
+ <head>
+ <title>UrBlog</title>
+ </head>
+
+ <body>
+ <h1>UrBlog</h1>
+ </body>
+</xml>
diff --git a/tests/urblog.urp b/tests/urblog.urp
new file mode 100644
index 00000000..08f0d657
--- /dev/null
+++ b/tests/urblog.urp
@@ -0,0 +1,4 @@
+database dbname=urblog
+sql urblog.sql
+
+urblog
diff --git a/tests/urblog.urs b/tests/urblog.urs
new file mode 100644
index 00000000..febad7b3
--- /dev/null
+++ b/tests/urblog.urs
@@ -0,0 +1,2 @@
+val list : unit -> transaction page
+val main : unit -> transaction page