1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
6 ;;;; Purpose: tests file
7 ;;;; Author: Kevin M. Rosenberg
8 ;;;; Date Started: Apr 2003
12 ;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg.
13 ;;;; Rights of modification and redistribution are in the LICENSE file.
15 ;;;; *************************************************************************
18 (defpackage #:lml-tests
19 (:use #:lml2 #:cl #:rtest))
20 (in-package #:lml-tests)
25 (with-output-to-string (s)
26 (let ((*html-stream* s))
31 (with-output-to-string (s)
32 (let ((*html-stream* s))
33 (html ((:span class 'foo) "Foo Bar"))))
34 "<span class=\"foo\">Foo Bar</span>")
37 (with-output-to-string (s)
38 (let ((*html-stream* s))
39 (html ((:table class "foo" :style "width:80%")
40 "Foo" " Bar" " test"))))
41 "<table class=\"foo\" style=\"width:80%\">Foo Bar test</table>")
44 (with-output-to-string (s)
45 (let ((*html-stream* s)
47 (html (:p (:princ a)))))
51 (with-output-to-string (s)
52 (let ((*html-stream* s)
54 (html ((:img :src "http://localhost/test.png" :width a)))))
55 "<img src=\"http://localhost/test.png\" width=\"0.75\" />")
58 (with-output-to-string (s)
59 (let ((*html-stream* s))
63 "<div>Start<p>Testing</p></div>")
66 (with-output-to-string (s)
67 (let ((*html-stream* s))
69 ((:div :style "font-weight:bold")
71 ((:p class 'a_class) "Testing")))))
72 "<div style=\"font-weight:bold\">Start<p class=\"a_class\">Testing</p></div>")
75 (with-output-to-string (s)
76 (let ((*html-stream* s)
79 ((:div :optional (:class class))
81 "<div class=\"aclass\">bod</div>")
84 (with-output-to-string (s)
85 (let ((*html-stream* s)
88 ((:div :optional (:class class))
93 (with-output-to-string (s)
94 (let ((*html-stream* s)
98 ((:div :when (:class do-class class))
100 "<div class=\"aclass\">bod</div>")
103 (with-output-to-string (s)
104 (let ((*html-stream* s)
108 ((:div :when (:class do-class class))
114 (with-output-to-string (s)
115 (let ((*html-stream* s)
118 ((:div :fformat (:onclick "a&b('~A')" v))))))
119 "<div onclick=\"a&b('10')\"></div>")
122 (with-output-to-string (s)
123 (let ((*html-stream* s)
126 ((:div :format (:onclick "a&b('~A')" v))))))
127 "<div onclick=\"a&b('10')\"></div>")
130 (with-output-to-string (s)
131 (let ((*html-stream* s)
135 ((:div :if (:width selector 1 2))))))
136 "<div width=\"1\"></div>")
139 (with-output-to-string (s)
140 (let ((*html-stream* s)
144 ((:div :if (:width selector 1 2))))))
145 "<div width=\"2\"></div>")