You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: org-blog-buffer.el
-136Lines changed: 0 additions & 136 deletions
Original file line number
Diff line number
Diff line change
@@ -165,139 +165,3 @@ update the buffer to reflect the values it contains."
165
165
(copy-alist merge)
166
166
(lambda (ab)
167
167
(string< (car b) (car a)))))))))
168
-
169
-
;;;; Declare tests if ert is loaded
170
-
(when (featurep'ert)
171
-
(ert-deftest ob-test-extract-from-empty ()
172
-
"Try extracting a post from an empty buffer."
173
-
(should
174
-
(equal (with-temp-buffer
175
-
(org-blog-buffer-extract-post))
176
-
nil)))
177
-
178
-
(ert-deftest ob-test-extract-from-buffer ()
179
-
"Try extracting a post from a buffer with stuff set."
180
-
(should
181
-
(equal (with-temp-buffer
182
-
(insert"\
183
-
#+POST_BLOG: t1b
184
-
#+POST_CATEGORY: t1c1, t1c2
185
-
#+DATE: [2013-01-25 Fri 00:00]
186
-
#+DESCRIPTION: t1e
187
-
#+POST_ID: 1
188
-
#+KEYWORDS: t1k1, t1k2, t1k3
189
-
#+POST_LINK: http://example.com/
190
-
#+POST_NAME: t1n
191
-
#+TITLE: Test 1 Title
192
-
#+POST_TYPE: post
193
-
194
-
Just a little bit of content.
195
-
There is still part of the paragraph. Line breaks are refolded.
196
-
197
-
#+BEGIN_VERSE
198
-
Though the material in verse should
199
-
retain
200
-
its line
201
-
breaks
202
-
#+END_VERSE
203
-
204
-
[[org-blog-buffer.el][There's a link in here, too]]")
205
-
(org-blog-buffer-extract-post))
206
-
'((:blog."t1b")
207
-
(:category"t1c1""t1c2")
208
-
(:content."<p>Just a little bit of content. There is still part of the paragraph. Line breaks are refolded.</p><p class=\"verse\">Though the material in verse should<br />retain<br />its line<br />breaks<br /></p><p><a href=\"org-blog-buffer.el\">There's a link in here, too</a></p>")
209
-
(:date207384432)
210
-
(:description."t1e")
211
-
(:id."1")
212
-
(:keywords"t1k1""t1k2""t1k3")
213
-
(:link."http://example.com/")
214
-
(:name."t1n")
215
-
(:title."Test 1 Title")
216
-
(:type."post")))))
217
-
218
-
(ert-deftest ob-test-merge-from-empty ()
219
-
"Try merging an empty post into an empty buffer."
220
-
(should
221
-
(equal (with-temp-buffer
222
-
(org-blog-buffer-merge-post '((:blog)
223
-
(:category)
224
-
(:content)
225
-
(:date)
226
-
(:description)
227
-
(:id)
228
-
(:keywords)
229
-
(:link)
230
-
(:name)
231
-
(:parent)
232
-
(:status)
233
-
(:title)
234
-
(:type)))
235
-
(buffer-string))
236
-
"")))
237
-
238
-
(ert-deftest ob-test-merge-from-full ()
239
-
"Try merging a full post into an empty buffer."
240
-
(should
241
-
(equal (with-temp-buffer
242
-
(org-blog-buffer-merge-post '((:blog."t1b")
243
-
(:category"t1c1""t1c2")
244
-
(:date207384432)
245
-
(:description."t1e")
246
-
(:id."1")
247
-
(:keywords"t1k1""t1k2""t1k3")
248
-
(:link."http://example.com/")
249
-
(:name."t1n")
250
-
(:parent."0")
251
-
(:status."publish")
252
-
(:title."Test 1 Title")
253
-
(:type."post")))
254
-
(buffer-string))
255
-
"\
256
-
#+POST_BLOG: t1b
257
-
#+POST_CATEGORY: t1c1, t1c2
258
-
#+DATE: [2013-01-25 Fri 00:00]
259
-
#+DESCRIPTION: t1e
260
-
#+POST_ID: 1
261
-
#+KEYWORDS: t1k1, t1k2, t1k3
262
-
#+POST_LINK: http://example.com/
263
-
#+POST_NAME: t1n
264
-
#+POST_PARENT: 0
265
-
#+POST_STATUS: publish
266
-
#+TITLE: Test 1 Title
267
-
#+POST_TYPE: post
268
-
")))
269
-
270
-
(ert-deftest ob-test-merge-round-trip ()
271
-
"Try merging a full post into a full buffer, and make sure
0 commit comments