]> gitweb.factorcode.org Git - factor.git/commitdiff
Add unit test for embedded.factor
authorslava <slava@factorcode.org>
Mon, 18 Dec 2006 07:26:54 +0000 (07:26 +0000)
committerslava <slava@factorcode.org>
Mon, 18 Dec 2006 07:26:54 +0000 (07:26 +0000)
libs/httpd/load.factor
libs/httpd/test/embedded.factor [new file with mode: 0644]
libs/httpd/test/example.fhtml [new file with mode: 0644]
libs/httpd/test/example.html [new file with mode: 0644]

index 0764011d4c19a007a2b2a896a2a89e2bac8ad8ce..1f27e14cfe3235363c7f741412e88261030181be 100644 (file)
@@ -20,6 +20,7 @@ PROVIDE: libs/httpd
     "test/html.factor"
     "test/httpd.factor"
     "test/url-encoding.factor"
+    "test/embedded.factor"
 } } ;
 
 USE: httpd
diff --git a/libs/httpd/test/embedded.factor b/libs/httpd/test/embedded.factor
new file mode 100644 (file)
index 0000000..d85845e
--- /dev/null
@@ -0,0 +1,11 @@
+IN: temporary
+USING: io embedded kernel test ;
+
+[ t ] [
+    "libs/httpd/test/example.fhtml" resource-path
+    [ run-embedded-file ] string-out
+    
+    "libs/httpd/test/example.html"
+    resource-path <file-reader> contents
+    =
+] unit-test
diff --git a/libs/httpd/test/example.fhtml b/libs/httpd/test/example.fhtml
new file mode 100644 (file)
index 0000000..211f44a
--- /dev/null
@@ -0,0 +1,8 @@
+<% USING: math ; %>
+
+<html>
+    <head><title>Simple Embedded Factor Example</title></head>
+    <body>
+        <% 5 [ %><p>I like repetition</p><% ] times %>
+    </body>
+</html>
diff --git a/libs/httpd/test/example.html b/libs/httpd/test/example.html
new file mode 100644 (file)
index 0000000..33829bf
--- /dev/null
@@ -0,0 +1,8 @@
+
+
+<html>
+    <head><title>Simple Embedded Factor Example</title></head>
+    <body>
+        <p>I like repetition</p><p>I like repetition</p><p>I like repetition</p><p>I like repetition</p><p>I like repetition</p>
+    </body>
+</html>