summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/env.ur21
-rw-r--r--tests/env.urp6
-rw-r--r--tests/env.urs1
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/env.ur b/tests/env.ur
new file mode 100644
index 00000000..637ea6b8
--- /dev/null
+++ b/tests/env.ur
@@ -0,0 +1,21 @@
+fun handler r =
+ vo <- getenv (blessEnvVar r.Nam);
+ return <xml><body>
+ {case vo of
+ None => <xml>Not set</xml>
+ | Some v => <xml>Set to: {[v]}</xml>}
+</body></xml>
+
+fun main () : transaction page =
+ term <- getenv (blessEnvVar "TERM");
+ return <xml><body>
+ TERM = {case term of
+ None => <xml>Nada</xml>
+ | Some v => txt v}
+
+ <form>
+ What would you like to know?
+ <textbox{#Nam}/>
+ <submit action={handler}/>
+ </form>
+ </body></xml>
diff --git a/tests/env.urp b/tests/env.urp
new file mode 100644
index 00000000..0860c8d7
--- /dev/null
+++ b/tests/env.urp
@@ -0,0 +1,6 @@
+rewrite url Env/*
+allow env TERM
+allow env DESKTOP_*
+allow env SCRIPT_NAME
+
+env
diff --git a/tests/env.urs b/tests/env.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/tests/env.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page