summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-12 10:48:01 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-12 10:48:01 -0400
commit036679102be68e0f1bb12c3e9a354bb743fde219 (patch)
tree8bf8f954b0b47affb35fe84621933a55dbd3d159 /tests
parent418f655bfaee62e8a371437c7a442a1d08c4c34f (diff)
More indenting
Diffstat (limited to 'tests')
-rw-r--r--tests/crud1.ur64
1 files changed, 36 insertions, 28 deletions
diff --git a/tests/crud1.ur b/tests/crud1.ur
index 6a7e38de..2ed2b9e7 100644
--- a/tests/crud1.ur
+++ b/tests/crud1.ur
@@ -1,36 +1,44 @@
table t1 : {Id : int, A : int, B : string, C : float, D : bool}
+val a = {Nam = "A",
+ Show = txt _,
+ Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
+ WidgetPopulated = fn (nm :: Name) n =>
+ <lform><textbox{nm} value={show _ n}/></lform>,
+ Parse = readError _,
+ Inject = _}
+
+val b = {Nam = "B",
+ Show = txt _,
+ Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
+ WidgetPopulated = fn (nm :: Name) s =>
+ <lform><textbox{nm} value={s}/></lform>,
+ Parse = readError _,
+ Inject = _}
+
+val c = {Nam = "C",
+ Show = txt _,
+ Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
+ WidgetPopulated = fn (nm :: Name) n =>
+ <lform><textbox{nm} value={show _ n}/></lform>,
+ Parse = readError _,
+ Inject = _}
+
+val d = {Nam = "D",
+ Show = txt _,
+ Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
+ WidgetPopulated = fn (nm :: Name) b =>
+ <lform><checkbox{nm} checked={b}/></lform>,
+ Parse = fn x => x,
+ Inject = _}
+
open Crud.Make(struct
val tab = t1
val title = "Crud1"
- val cols = {
- A = {Nam = "A",
- Show = txt _,
- Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
- WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
- Parse = readError _,
- Inject = _},
- B = {Nam = "B",
- Show = txt _,
- Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
- WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>,
- Parse = readError _,
- Inject = _
- },
- C = {Nam = "C",
- Show = txt _,
- Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
- WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
- Parse = readError _,
- Inject = _
- },
- D = {Nam = "D",
- Show = txt _,
- Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
- WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>,
- Parse = fn x => x,
- Inject = _}
- }
+ val cols = {A = a,
+ B = b,
+ C = c,
+ D = d}
end)