emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 331f4a6: Encode the shr tests files with trailing w


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 331f4a6: Encode the shr tests files with trailing white space
Date: Sun, 24 Apr 2016 13:18:32 +0000

branch: master
commit 331f4a638150c1ab8ae5bea86b901f32263b9192
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    Encode the shr tests files with trailing white space
---
 .gitattributes             |    3 ---
 test/data/shr/li-empty.txt |    6 +++---
 test/lisp/net/shr-tests.el |    3 +++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 24fe4c7..13e58a8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -33,9 +33,6 @@ test/etags/html-src/algrthms.html whitespace=cr-at-eol
 # The upstream maintainer does not want to remove trailing whitespace.
 doc/misc/texinfo.tex -whitespace=blank-at-eol
 
-# The shr test files can have trailing whitespace.
-test/data/shr/*.txt -whitespace=blank-at-eol
-
 # Some files should not be treated as text when diffing or merging.
 *.cur binary
 *.gpg binary
diff --git a/test/data/shr/li-empty.txt b/test/data/shr/li-empty.txt
index 8320bc0..906fd8d 100644
--- a/test/data/shr/li-empty.txt
+++ b/test/data/shr/li-empty.txt
@@ -1,3 +1,3 @@
-1 
-2 
-3 
+1%20
+2%20
+3%20
diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el
index 6606ec5..ab6fc93 100644
--- a/test/lisp/net/shr-tests.el
+++ b/test/lisp/net/shr-tests.el
@@ -36,6 +36,9 @@
       (cons (buffer-substring-no-properties (point-min) (point-max))
             (with-temp-buffer
               (insert-file-contents (format "data/shr/%s.txt" name))
+              (while (re-search-forward "%\\([0-9A-F][0-9A-F]\\)" nil t)
+                (replace-match (string (string-to-number (match-string 1) 16))
+                               t t))
               (buffer-string))))))
 
 (ert-deftest rendering ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]