summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unpoly.ur28
-rw-r--r--tests/unpoly.urp2
-rw-r--r--tests/unpoly.urs1
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/unpoly.ur b/tests/unpoly.ur
new file mode 100644
index 00000000..706f3653
--- /dev/null
+++ b/tests/unpoly.ur
@@ -0,0 +1,28 @@
+val current = return (Some "1")
+fun resolve (_ : string) = return (Some "2")
+
+fun checkDeps deps =
+ u <- current;
+ List.foldlM (fn s (good, errs) =>
+ v' <- resolve s;
+ case v' of
+ None =>
+ return (False, <xml>
+ {errs}
+ Unknown library path <tt>{[s]}</tt>.<br/>
+ </xml>)
+ | Some v' =>
+ b <- return True;
+ if b then
+ return (good, errs)
+ else
+ return (False, <xml>
+ {errs}
+ Access denied to <tt>{[s]}</tt>.<br/>
+ </xml>)) (True, <xml/>) deps
+
+fun main () =
+ p <- checkDeps ("a" :: "b" :: []);
+ return <xml><body>
+ {p.2}
+ </body></xml>
diff --git a/tests/unpoly.urp b/tests/unpoly.urp
new file mode 100644
index 00000000..106bd20d
--- /dev/null
+++ b/tests/unpoly.urp
@@ -0,0 +1,2 @@
+$/list
+unpoly
diff --git a/tests/unpoly.urs b/tests/unpoly.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/tests/unpoly.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page