]> gitweb.factorcode.org Git - factor.git/commitdiff
webapps.mason.report: fix and tc for the stack underflow error in build reports
authorBjörn Lindqvist <bjourne@gmail.com>
Thu, 24 Sep 2015 09:33:06 +0000 (11:33 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Thu, 24 Sep 2015 09:33:06 +0000 (11:33 +0200)
extra/webapps/mason/report/report-tests.factor [new file with mode: 0644]
extra/webapps/mason/report/report.factor

diff --git a/extra/webapps/mason/report/report-tests.factor b/extra/webapps/mason/report/report-tests.factor
new file mode 100644 (file)
index 0000000..e623690
--- /dev/null
@@ -0,0 +1,7 @@
+USING: accessors stack-checker tools.test webapps.mason.report ;
+IN: webapps.mason.report.tests
+
+! <build-report-action>
+{ ( -- x ) } [
+    <build-report-action> display>> infer
+] unit-test
index 6f64f4c9b5a4d75736b29ae5e84e8feecec49092..a82fc30e8f7061ad74794d8ed0f6ddf9c22e8c2b 100644 (file)
@@ -4,18 +4,17 @@ USING: accessors furnace.actions http.server.responses kernel
 urls xml.syntax webapps.mason.backend webapps.mason.utils ;
 IN: webapps.mason.report
 
+: build-report ( -- response )
+    [
+        current-builder [
+            last-report>> <html-content>
+        ] [ <404> ] if*
+    ] with-mason-db ;
+
 : <build-report-action> ( -- action )
     <action>
         [ validate-os/cpu ] >>init
-        [
-            [
-                current-builder [
-                    last-report>> <html-content>
-                ] [
-                    <404>
-                ] if
-            ] with-mason-db
-        ] >>display ;
+        [ build-report ] >>display ;
 
 : report-link ( builder -- xml )
     [ URL" report" ] dip