r5293: *** 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.2 2003/07/12 17:54:05 kevin Exp $
11 ;;;;
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.
14 ;;;;
15 ;;;; *************************************************************************
16
17 (in-package #:cl)
18 (defpackage #:lml-tests
19   (:use #:lml #:cl #:rtest))
20 (in-package #:lml-tests)
21
22 (rem-all-tests)
23
24 (deftest lml.0
25   (with-output-to-string (s)
26     (let ((*html-output* s))
27       (div)))
28   "<div></div>")
29
30 (deftest lml.1
31   (with-output-to-string (s)
32     (let ((*html-output* s))
33       (span-c foo "Foo Bar")))
34   "<span class=\"foo\">Foo Bar</span>")
35
36 (deftest lml.2
37   (with-output-to-string (s)
38     (let ((*html-output* s))
39       (table-c foo :style "width:80%" "Foo" " Bar" " test")))
40   "<table class=\"foo\" style=\"width:80%\">Foo Bar test</table>")
41
42 (deftest lml.3
43   (with-output-to-string (s)
44     (let ((*html-output* s)
45           (a 5.5d0))
46       (p a)))
47   "<p>5.5d0</p>")
48
49 (deftest lml.4
50   (with-output-to-string (s)
51     (let ((*html-output* s)
52           (a 0.75))
53       (img "http://localhost/test.png" :width a)))
54   "<img src=\"http://localhost/test.png\" width=\"0.75\" />")
55
56 (deftest lml.5
57   (with-output-to-string (s)
58     (let ((*html-output* s))
59       (div "Start"
60            (p "Testing"))))
61   "<div>Start<p>Testing</p></div>")
62
63 (deftest lml.6
64   (with-output-to-string (s)
65     (let ((*html-output* s))
66       (div :style "font-weight:bold"
67            "Start"
68            (p-c a_class "Testing"))))
69   "<div style=\"font-weight:bold\">Start<p class=\"a_class\">Testing</p></div>")
70