aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-04-07 11:19:03 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-04-07 19:52:18 +0100
commit0abf0bb8536f6d77206dd3aa0c84792f0d8ba859 (patch)
tree01d7ef31d190211884fc8b80a4ac5d9b4e2f8b5a /test
parente78510b2d4fd0efe9da9bbe1daa2c7e3d54984d9 (diff)
Improve question printing logic.
Process line breaks to look like processed markdown. Avoid processing links inside pre-blocks.
Diffstat (limited to 'test')
-rw-r--r--test/test-printing.el67
1 files changed, 53 insertions, 14 deletions
diff --git a/test/test-printing.el b/test/test-printing.el
index 4f0b3dc..5f5fddb 100644
--- a/test/test-printing.el
+++ b/test/test-printing.el
@@ -166,23 +166,21 @@ after being run through `sx-tag--format'."
(ert-deftest sx-question-mode--fill-and-fontify ()
"Check complicated questions are filled correctly."
- (should
- (equal
- (with-temp-buffer
- (sx-question-mode--insert-markdown
- "Creating an account on a new site requires you to log into that site using *the same credentials you used on existing sites.* For instance, if you used the Stack Exchange login method, you'd...
+ (with-temp-buffer
+ (sx-question-mode--insert-markdown
+ "Creating an account on a new site requires you to log into that site using *the same credentials you used on existing sites.* For instance, if you used the Stack Exchange login method, you'd...
1. Click the \"Log in using Stack Exchange\" button:
- ![][1]
+ ![image][1]
2. Enter your username and password (yes, even if you *just did this* to log into, say, Stack Overflow) and press the \"Log In\" button:
- ![][2]
+ [link][2]
3. Confirm the creation of the new account:
- ![][3]
+ [![image-in-link][3]](emacs.stackexchange.com)
some code block
some code block
@@ -194,23 +192,35 @@ after being run through `sx-tag--format'."
[1]: http://i.stack.imgur.com/ktFTs.png
[2]: http://i.stack.imgur.com/5l2AY.png
[3]: http://i.stack.imgur.com/22myl.png")
- (buffer-string))
- "Creating an account on a new site requires you to log into that site
+ (when sx-question-mode-use-images
+ (should (overlays-in (point-min) (point-max)))
+ (should (= 2 (length (overlays-in (point-min) (point-max))))))
+ (if sx-question-mode-use-images
+ (should
+ (equal
+ (buffer-substring-no-properties (point-min) (point-max))
+ "Creating an account on a new site requires you to log into that site
using *the same credentials you used on existing sites.* For instance,
if you used the Stack Exchange login method, you'd...
1. Click the \"Log in using Stack Exchange\" button:
- ![][1]
+
+
+
2. Enter your username and password (yes, even if you *just did this*
to log into, say, Stack Overflow) and press the \"Log In\" button:
- ![][2]
+link
3. Confirm the creation of the new account:
- ![][3]
+
+
+
some code block
some code block
@@ -221,5 +231,34 @@ if you used the Stack Exchange login method, you'd...
[1]: http://i.stack.imgur.com/ktFTs.png
[2]: http://i.stack.imgur.com/5l2AY.png
- [3]: http://i.stack.imgur.com/22myl.png")))
+ [3]: http://i.stack.imgur.com/22myl.png"))
+ (should
+ (equal
+ (buffer-substring-no-properties (point-min) (point-max))
+ "Creating an account on a new site requires you to log into that site
+using *the same credentials you used on existing sites.* For instance,
+if you used the Stack Exchange login method, you'd...
+
+1. Click the \"Log in using Stack Exchange\" button:
+image
+
+2. Enter your username and password (yes, even if you *just did this*
+ to log into, say, Stack Overflow) and press the \"Log In\" button:
+
+link
+
+3. Confirm the creation of the new account:
+
+image-in-link
+
+ some code block
+ some code block
+ some code block
+ some code block
+ some code block
+ some code block
+
+ [1]: http://i.stack.imgur.com/ktFTs.png
+ [2]: http://i.stack.imgur.com/5l2AY.png
+ [3]: http://i.stack.imgur.com/22myl.png")))))