Debian Codegraph @

test-suite/tests/texinfo.plain-text.test

raw
1 ;;;; texinfo.plain-text.test -*- scheme -*-
2 ;;;;
3 ;;;; Copyright (C) 2020 Free Software Foundation, Inc.
4 ;;;;
5 ;;;; This program is free software; you can redistribute it and/or
6 ;;;; modify it under the terms of the GNU General Public License as
7 ;;;; published by the Free Software Foundation; either version 3 of the
8 ;;;; License, or (at your option) any later version.
9 ;;;;
10 ;;;; This program is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ;;;; General Public License for more details.
14 ;;;;
15 ;;;; You should have received a copy of the GNU General Public License
16 ;;;; along with this library; if not, write to the Free Software
17 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 ;;;; 02110-1301 USA
19
20 (define-module (test-suite test-plain-text)
21 #:use-module (test-suite lib)
22 #:use-module (texinfo plain-text))
23
24 (with-test-prefix "stexi->plain-text"
25 (pass-if-equal "one paragraph, default line width"
26 "This is another sentence. That too.\n\n"
27 (stexi->plain-text
28 '(*fragment* (para "This is another sentence. That too."))))
29
30 (pass-if-equal "one paragraph, *line-width* set"
31 "This is another sentence.\nThat too.\n\n"
32 (with-fluids ((*line-width* 26))
33 (stexi->plain-text
34 '(*fragment* (para "This is another sentence. That too.")))))
35
36 (pass-if-equal "acronym"
37 "What's GNU (GNU's Not Unix)?\n\n"
38 (stexi->plain-text
39 '(*fragment* (para "What's "
40 (acronym (% (acronym "GNU")
41 (meaning "GNU's Not Unix")))
42 "?"))))
43
44 (pass-if-equal "recursive acronym"
45 "What's GNU (GNU's Not Unix)?\n\n"
46 (stexi->plain-text
47 '(*fragment* (para "What's "
48 (acronym (% (acronym "GNU")
49 (meaning (acronym
50 (% (acronym "GNU")))
51 "'s Not Unix")))
52 "?")))))