X-Git-Url: http://git.kpe.io/?p=lml2.git;a=blobdiff_plain;f=tests.lisp;h=12265fb102831a82c3c5caaff44a665ade8771ee;hp=6116688e52899b91d5cde8e96d02b2dbd6fc8ce2;hb=89cf1a9e0c28e8e4707f5541b831b5025f953956;hpb=5ab89e5feddfcb04a762cc3033c5c21f9a1d44b7 diff --git a/tests.lisp b/tests.lisp index 6116688..12265fb 100644 --- a/tests.lisp +++ b/tests.lisp @@ -2,12 +2,12 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: lml-tests.lisp -;;;; Purpose: lml tests file +;;;; Name: tests.lisp +;;;; Purpose: tests file ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: tests.lisp,v 1.2 2003/07/12 17:54:05 kevin Exp $ +;;;; $Id: tests.lisp,v 1.3 2003/07/15 19:25:28 kevin Exp $ ;;;; ;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg. ;;;; Rights of modification and redistribution are in the LICENSE file. @@ -16,55 +16,130 @@ (in-package #:cl) (defpackage #:lml-tests - (:use #:lml #:cl #:rtest)) + (:use #:lml2 #:cl #:rtest)) (in-package #:lml-tests) (rem-all-tests) (deftest lml.0 (with-output-to-string (s) - (let ((*html-output* s)) - (div))) + (let ((*html-stream* s)) + (html (:div)))) "
") (deftest lml.1 (with-output-to-string (s) - (let ((*html-output* s)) - (span-c foo "Foo Bar"))) + (let ((*html-stream* s)) + (html ((:span class 'foo) "Foo Bar")))) "Foo Bar") (deftest lml.2 (with-output-to-string (s) - (let ((*html-output* s)) - (table-c foo :style "width:80%" "Foo" " Bar" " test"))) + (let ((*html-stream* s)) + (html ((:table class "foo" :style "width:80%") + "Foo" " Bar" " test")))) "Foo Bar test
") (deftest lml.3 (with-output-to-string (s) - (let ((*html-output* s) + (let ((*html-stream* s) (a 5.5d0)) - (p a))) + (html (:p (:princ a))))) "

5.5d0

") (deftest lml.4 (with-output-to-string (s) - (let ((*html-output* s) + (let ((*html-stream* s) (a 0.75)) - (img "http://localhost/test.png" :width a))) + (html ((:img :src "http://localhost/test.png" :width a))))) "") (deftest lml.5 (with-output-to-string (s) - (let ((*html-output* s)) - (div "Start" - (p "Testing")))) + (let ((*html-stream* s)) + (html + (:div "Start" + (:p "Testing"))))) "
Start

Testing

") (deftest lml.6 (with-output-to-string (s) - (let ((*html-output* s)) - (div :style "font-weight:bold" - "Start" - (p-c a_class "Testing")))) + (let ((*html-stream* s)) + (html + ((:div :style "font-weight:bold") + "Start" + ((:p class 'a_class) "Testing"))))) "
Start

Testing

") +(deftest lml.7 + (with-output-to-string (s) + (let ((*html-stream* s) + (class "aclass")) + (html + ((:div :optional (:class class)) + "bod")))) + "
bod
") + +(deftest lml.8 + (with-output-to-string (s) + (let ((*html-stream* s) + (class nil)) + (html + ((:div :optional (:class class)) + "bod")))) + "
bod
") + +(deftest lml.9 + (with-output-to-string (s) + (let ((*html-stream* s) + (do-class t) + (class "aclass")) + (html + ((:div :when (:class do-class class)) + "bod")))) + "
bod
") + +(deftest lml.10 + (with-output-to-string (s) + (let ((*html-stream* s) + (do-class nil) + (class "aclass")) + (html + ((:div :when (:class do-class class)) + "bod")))) + "
bod
") + + +(deftest lml.11 + (with-output-to-string (s) + (let ((*html-stream* s) + (v 10)) + (html + ((:div :fformat (:onclick "a&b('~A')" v)))))) + "
") + +(deftest lml.12 + (with-output-to-string (s) + (let ((*html-stream* s) + (v 10)) + (html + ((:div :format (:onclick "a&b('~A')" v)))))) + "
") + +(deftest lml.13 + (with-output-to-string (s) + (let ((*html-stream* s) + (selector t) + (v 10)) + (html + ((:div :if (:width selector 1 2)))))) + "
") + +(deftest lml.14 + (with-output-to-string (s) + (let ((*html-stream* s) + (selector nil) + (v 10)) + (html + ((:div :if (:width selector 1 2)))))) + "
")