r5219: *** empty log message ***
[lml2.git] / tests.lisp
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          lml-tests.lisp
6 ;;;; Purpose:       lml tests file
7 ;;;; Author:        Kevin M. Rosenberg
8 ;;;; Date Started:  Apr 2003
9 ;;;;
10 ;;;; $Id: tests.lisp,v 1.1 2003/06/20 04:12:29 kevin Exp $
11 ;;;;
12 ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
13 ;;;;
14 ;;;; *************************************************************************
15
16 (in-package #:cl)
17 (defpackage #:lml-tests
18   (:use #:lml #:cl #:rtest))
19 (in-package #:lml-tests)
20
21 (rem-all-tests)
22
23 (deftest lml.0
24   (with-output-to-string (s)
25     (let ((*html-output* s))
26       (div)))
27   "<div></div>")
28
29 (deftest lml.1
30   (with-output-to-string (s)
31     (let ((*html-output* s))
32       (span-c foo "Foo Bar")))
33   "<span class=\"foo\">Foo Bar</span>")
34
35 (deftest lml.2
36   (with-output-to-string (s)
37     (let ((*html-output* s))
38       (table-c foo :style "width:80%" "Foo" " Bar" " test")))
39   "<table class=\"foo\" style=\"width:80%\">Foo Bar test</table>")
40
41 (deftest lml.3
42   (with-output-to-string (s)
43     (let ((*html-output* s)
44           (a 5.5d0))
45       (p a)))
46   "<p>5.5d0</p>")
47
48 (deftest lml.4
49   (with-output-to-string (s)
50     (let ((*html-output* s)
51           (a 0.75))
52       (img "http://localhost/test.png" :width a)))
53   "<img src=\"http://localhost/test.png\" width=\"0.75\" />")
54
55 (deftest lml.5
56   (with-output-to-string (s)
57     (let ((*html-output* s))
58       (div "Start"
59            (p "Testing"))))
60   "<div>Start<p>Testing</p></div>")
61
62 (deftest lml.6
63   (with-output-to-string (s)
64     (let ((*html-output* s))
65       (div :style "font-weight:bold"
66            "Start"
67            (p-c a_class "Testing"))))
68   "<div style=\"font-weight:bold\">Start<p class=\"a_class\">Testing</p></div>")
69