File: message-body.at

package info (click to toggle)
mailutils 1%3A3.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 38,912 kB
  • sloc: ansic: 187,772; sh: 111,430; yacc: 7,463; cpp: 3,834; makefile: 3,166; lex: 1,972; python: 1,617; exp: 1,563; awk: 152; lisp: 132; sed: 31
file content (42 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This file is part of GNU Mailutils                    -*- Autotest -*-
# Copyright (C) 2018-2025 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.

AT_SETUP([message body])
AT_KEYWORDS([message body])
MU_GUILE_CHECK([
(use-modules ((ice-9 binary-ports)))

(let ((msg (mu-message-create)))
  (display "writing\n")
  (mu-message-set-header msg "From" "user@example.org")
  (mu-message-set-header msg "Subject" "test")
  (let ((port (mu-message-get-port msg "w")))
    (with-output-to-port
	port
      (lambda ()
	(display "Test message\n")))
    (close-port port))

  (message-format #t msg)
  (newline)

  (display "body\n")
  (let ((b (mu-message-get-body msg)))
    (display b)
    (newline)
    (do ((ln (mu-body-read-line b) (mu-body-read-line b)))
        ((eof-object? ln))
      (display ln))))],
  0,
  [writing
#<message "X@Y" "Dow Mon Day HH:MM" 4 51>
body
#<body 1 13>
Test message
])
AT_CLEANUP