-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2801 from bauermann/fix-msg-body
guile: Fix the mu:body message method
- Loading branch information
Showing
7 changed files
with
46 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,23 @@ exec guile -e main -s $0 $@ | |
(str-equal-or-exit (mu:subject msg) "atoms") | ||
(str-equal-or-exit (mu:to msg) "Democritus <[email protected]>") | ||
(str-equal-or-exit (mu:from msg) "Richard P. Feynman <[email protected]>") | ||
;;(str-equal-or-exit (mu:header msg "Content-transfer-encoding") "7BIT") | ||
;;(str-equal-or-exit (mu:header msg "Content-Transfer-Encoding") "8bit") | ||
(str-equal-or-exit (mu:body msg) | ||
(string-join | ||
'("If, in some cataclysm, all scientific knowledge were to be destroyed," | ||
"and only one sentence passed on to the next generation of creatures," | ||
"what statement would contain the most information in the fewest words?" | ||
"I believe it is the atomic hypothesis (or atomic fact, or whatever you" | ||
"wish to call it) that all things are made of atoms — little particles" | ||
"that move around in perpetual motion, attracting each other when they" | ||
"are a little distance apart, but repelling upon being squeezed into" | ||
"one another. In that one sentence you will see an enormous amount of" | ||
"information about the world, if just a little imagination and thinking" | ||
"are applied.\n") "\n")) | ||
(str-equal-or-exit (mu:body-txt msg) (mu:body msg)) | ||
(let ((got (mu:body-html msg))) | ||
(if got | ||
(error-exit "Expected #f, got ~a" got))) | ||
|
||
(if (not (equal? (mu:priority msg) mu:prio:high)) | ||
(error-exit "Expected ~a, got ~a" (mu:priority msg) mu:prio:high)))) | ||
|
@@ -97,7 +113,7 @@ exec guile -e main -s $0 $@ | |
(define (test-stats) | ||
"Test statistical functions." | ||
;; average | ||
(num-equal-or-exit (mu:average mu:size) 82601/14) | ||
(num-equal-or-exit (mu:average mu:size) 41299/7) | ||
(num-equal-or-exit (floor (mu:stddev mu:size)) 12637.0) | ||
(num-equal-or-exit (mu:max mu:size) 46308) | ||
(num-equal-or-exit (mu:min mu:size) 111)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ Subject: atoms | |
To: "Democritus" <[email protected]> | ||
Message-id: <[email protected]> | ||
MIME-version: 1.0 | ||
Content-type: text/plain; charset=us-ascii | ||
Content-transfer-encoding: 7BIT | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
Precedence: high | ||
|
||
If, in some cataclysm, all scientific knowledge were to be destroyed, | ||
|