Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

-formlets-test now needs to be run manually instead of starting a ser…

…ver automatically on loading (this is to help with `asdf-install`ing the package)
  • Loading branch information...
commit 98ceb930c83d9666f484443e3385a81411a51ff7 1 parent 059674a
ingram authored
Showing with 8 additions and 4 deletions.
  1. +1 −1  README.md
  2. +1 −0  test-package.lisp
  3. +6 −3 test.lisp
View
2  README.md
@@ -74,7 +74,7 @@ Finally, the newly added set-predicates expect a list of values as input from th
+ `picked-exactly?` Num -> ([String] -> Bool)
### Tutorial
-To see some example code, check out the `test.lisp` file (to see it in action, load the `formlets-test` system). An example form declaration using a general validation message:
+To see some example code, check out the `test.lisp` file (to see it in action, load the `formlets-test` system and run the `formlets-test` function, then check out localhost:4141). An example form declaration using a general validation message:
(define-formlet (login :submit "Login" :general-validation (#'check-password "I see what you did there. ಠ_ಠ"))
((user-name text) (password password))
View
1  test-package.lisp
@@ -1,2 +1,3 @@
(defpackage :formlets-test (:use :cl :cl-who :hunchentoot :formlets)
+ (:export :formlets-test)
(:documentation "A package implementing the testing tools auto-validating formlets for Hunchentoot"))
View
9 test.lisp
@@ -18,6 +18,11 @@
.formlet-error { position: absolute; padding: 2px; margin-left: 5px; }
.general-error { position: relative; }")
+(defvar *web-server* nil)
+
+(defun formlets-test (&optional (port 4141))
+ (setf *web-server* (start (make-instance 'acceptor :port port))))
+
(defmacro page-template ((&key title) &body body)
`(with-html-output-to-string (*standard-output* nil :prologue t :indent t)
(:html :xmlns "http://www.w3.org/1999/xhtml" :xml\:lang "en" :lang "en"
@@ -104,6 +109,4 @@
(:hr) (show-formlet test-form-three)
(:hr) (show-formlet faux-login-form)
(:hr) (show-formlet default-values-form
- :default-values (list "Something" "Something else" "A textarea! Yay!" "three" (list "two")))))
-
-(defvar *web-server* (start (make-instance 'acceptor :port 4141)))
+ :default-values (list "Something" "Something else" "A textarea! Yay!" "three" (list "two")))))
Please sign in to comment.
Something went wrong with that request. Please try again.