texinfo.plain-text.test 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. (define-module (test-suite test-plain-text)
  20. #:use-module (test-suite lib)
  21. #:use-module (texinfo plain-text))
  22. (with-test-prefix "stexi->plain-text"
  23. (pass-if-equal "one paragraph, default line width"
  24. "This is another sentence. That too.\n\n"
  25. (stexi->plain-text
  26. '(*fragment* (para "This is another sentence. That too."))))
  27. (pass-if-equal "one paragraph, *line-width* set"
  28. "This is another sentence.\nThat too.\n\n"
  29. (with-fluids ((*line-width* 26))
  30. (stexi->plain-text
  31. '(*fragment* (para "This is another sentence. That too.")))))
  32. (pass-if-equal "acronym"
  33. "What's GNU (GNU's Not Unix)?\n\n"
  34. (stexi->plain-text
  35. '(*fragment* (para "What's "
  36. (acronym (% (acronym "GNU")
  37. (meaning "GNU's Not Unix")))
  38. "?"))))
  39. (pass-if-equal "recursive acronym"
  40. "What's GNU (GNU's Not Unix)?\n\n"
  41. (stexi->plain-text
  42. '(*fragment* (para "What's "
  43. (acronym (% (acronym "GNU")
  44. (meaning (acronym
  45. (% (acronym "GNU")))
  46. "'s Not Unix")))
  47. "?")))))