summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-22 15:12:20 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-22 15:12:20 -0400
commite8ceaa0ae216c7c85e810998ab97989e7a83c82d (patch)
treef26deeee6825b28bb3e6005523f887de3c1a79a4 /tests
parentb1997d2e699e92e83f7130b7b4a4c5467dcdcd27 (diff)
Simple forms work
Diffstat (limited to 'tests')
-rw-r--r--tests/form2.lac25
-rw-r--r--tests/form3.lac39
-rw-r--r--tests/link.lac4
-rw-r--r--tests/plink.lac2
4 files changed, 67 insertions, 3 deletions
diff --git a/tests/form2.lac b/tests/form2.lac
new file mode 100644
index 00000000..d3ea4736
--- /dev/null
+++ b/tests/form2.lac
@@ -0,0 +1,25 @@
+val handler1 = fn r => <html><body>
+ <li> Name: {cdata r.Nam}</li>
+ <li> Word: {cdata r.Word}</li>
+</body></html>
+
+val handler2 = fn r => <html><body>
+ <li> Name: {cdata r.Nam}</li>
+ <li> Ward: {cdata r.Ward}</li>
+</body></html>
+
+val main : unit -> page = fn () => <html><body>
+ <lform>
+ Name: <textbox{#Nam} /><br/>
+ Word: <textbox{#Word} /><br/>
+
+ <submit action={handler1}/>
+ </lform>
+
+ <lform>
+ Name: <textbox{#Nam} /><br/>
+ Word: <textbox{#Ward} /><br/>
+
+ <submit action={handler2}/>
+ </lform>
+</body></html>
diff --git a/tests/form3.lac b/tests/form3.lac
new file mode 100644
index 00000000..3c0915f7
--- /dev/null
+++ b/tests/form3.lac
@@ -0,0 +1,39 @@
+val handler1 = fn r => <html><body>
+ <li> Name: {cdata r.Nam}</li>
+ <li> Word: {cdata r.Word}</li>
+</body></html>
+
+val handler2 = fn r => <html><body>
+ <li> Name: {cdata r.Nam}</li>
+ <li> Ward: {cdata r.Ward}</li>
+</body></html>
+
+val handler3 = fn r => <html><body>
+ <li> Name: {cdata r.Nam}</li>
+ <li> Ward: {cdata r.Ward}</li>
+ <li> Words: {cdata r.Words}</li>
+</body></html>
+
+val main : unit -> page = fn () => <html><body>
+ <lform>
+ Name: <textbox{#Nam} /><br/>
+ Word: <textbox{#Word} /><br/>
+
+ <submit action={handler1}/>
+ </lform>
+
+ <lform>
+ Name: <textbox{#Nam} /><br/>
+ Word: <textbox{#Ward} /><br/>
+
+ <submit action={handler2}/>
+ </lform>
+
+ <lform>
+ Name: <textbox{#Nam} /><br/>
+ Ward: <textbox{#Ward} /><br/>
+ Words: <textbox{#Words} /><br/>
+
+ <submit action={handler3}/>
+ </lform>
+</body></html>
diff --git a/tests/link.lac b/tests/link.lac
index 8d806c54..26f093ed 100644
--- a/tests/link.lac
+++ b/tests/link.lac
@@ -1,7 +1,7 @@
-val ancillary : {} -> xhtml = fn () => <html>
+val ancillary = fn () => <html>
Welcome to the ancillary page!
</html>
-val main : {} -> xhtml = fn () => <html><body>
+val main : unit -> page = fn () => <html><body>
<a link={ancillary ()}>Enter the unknown!</a>
</body></html>
diff --git a/tests/plink.lac b/tests/plink.lac
index 9601f08a..eda255f4 100644
--- a/tests/plink.lac
+++ b/tests/plink.lac
@@ -2,7 +2,7 @@ val pA = fn size => <html><body>
<font size={size}>Hello World!</font>
</body></html>
-val main = fn () => <html><body>
+val main : unit -> page = fn () => <html><body>
<li> <a link={pA 5}>Size 5</a></li>
<li> <a link={pA 10}>Size 10</a></li>
</body></html>