test-ox-publish.el 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. ;;; test-ox-publish.el --- Tests for "ox-publish.el" -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 2016, 2019 Nicolas Goaziou
  3. ;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
  4. ;; This program is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. ;;; Code:
  15. (require 'org-test "../testing/org-test")
  16. (require 'ox-publish)
  17. ;;; Helper functions
  18. (defun org-test-publish (properties handler &optional remove-prop)
  19. "Publish a project defined by PROPERTIES.
  20. Call HANDLER with the publishing directory as its sole argument.
  21. Unless set otherwise in PROPERTIES, `:base-directory' is set to
  22. \"examples/pub/\" sub-directory from test directory and
  23. `:publishing-function' is set to `org-publish-attachment'.
  24. Because `org-publish-property' uses `plist-member' to check the
  25. existence of a property, a property with a value nil is different
  26. from a non-existing property. Properties in REMOVE-PROP will be
  27. removed from the final plist."
  28. (declare (indent 1))
  29. (let* ((org-publish-use-timestamps-flag nil)
  30. (org-publish-cache nil)
  31. (base-dir (expand-file-name "examples/pub/" org-test-dir))
  32. (pub-dir (make-temp-file "org-test" t))
  33. (org-publish-timestamp-directory
  34. (expand-file-name ".org-timestamps/" pub-dir))
  35. (props (org-plist-delete-all
  36. (org-combine-plists
  37. `(:base-directory ,base-dir
  38. :publishing-function org-publish-attachment)
  39. properties
  40. `(:publishing-directory ,pub-dir))
  41. remove-prop))
  42. (project
  43. `("test" ,@props)))
  44. (unwind-protect
  45. (progn
  46. (org-publish-projects (list project))
  47. (funcall handler pub-dir))
  48. ;; Clear published data.
  49. (delete-directory pub-dir t)
  50. ;; Delete auto-generated site-map file, if applicable.
  51. (let ((site-map (and (plist-get properties :auto-sitemap)
  52. (expand-file-name
  53. (or (plist-get properties :sitemap-filename)
  54. "sitemap.org")
  55. base-dir))))
  56. (when (and site-map (file-exists-p site-map))
  57. (delete-file site-map))))))
  58. ;;; Mandatory properties
  59. (ert-deftest test-org-publish/base-extension ()
  60. "Test `:base-extension' specifications"
  61. ;; Regular tests.
  62. (should
  63. (equal '("a.org" "b.org")
  64. (org-test-publish '(:base-extension "org")
  65. (lambda (dir)
  66. (remove ".org-timestamps"
  67. (cl-remove-if #'file-directory-p
  68. (directory-files dir)))))))
  69. (should
  70. (equal '("file.txt")
  71. (org-test-publish '(:base-extension "txt")
  72. (lambda (dir)
  73. (remove ".org-timestamps"
  74. (cl-remove-if #'file-directory-p
  75. (directory-files dir)))))))
  76. ;; A nil value is equivalent to ".org".
  77. (should
  78. (equal '("a.org" "b.org")
  79. (org-test-publish '(:base-extension nil)
  80. (lambda (dir)
  81. (remove ".org-timestamps"
  82. (cl-remove-if #'file-directory-p
  83. (directory-files dir)))))))
  84. ;; Symbol `any' includes all files, even those without extension.
  85. (should
  86. (equal '("a.org" "b.org" "file.txt" "noextension")
  87. (org-test-publish '(:base-extension any)
  88. (lambda (dir)
  89. (remove ".org-timestamps"
  90. (cl-remove-if #'file-directory-p
  91. (directory-files dir)))))))
  92. ;; Check the default transformation function,
  93. ;; org-html-publish-to-html. Because org-test-publish uses
  94. ;; org-publish-attachment by default, we must not just override with
  95. ;; nil but tell it to remove the :publishing-function from the list.
  96. (should
  97. (let ((func (lambda (dir)
  98. (with-temp-buffer
  99. (insert-file-contents (expand-file-name "a.html" dir))
  100. (buffer-string)))))
  101. (equal (org-test-publish nil func '(:publishing-function))
  102. (org-test-publish '(:publishing-function org-html-publish-to-html) func)))))
  103. ;;; Site-map
  104. (ert-deftest test-org-publish/sitemap ()
  105. "Test site-map specifications."
  106. ;; Site-map creation is controlled with `:auto-sitemap'. It
  107. ;; defaults to "sitemap.org".
  108. (should
  109. (org-test-publish
  110. '(:auto-sitemap t)
  111. (lambda (dir) (file-exists-p (expand-file-name "sitemap.org" dir)))))
  112. (should-not
  113. (org-test-publish
  114. '(:auto-sitemap nil)
  115. (lambda (dir) (file-exists-p (expand-file-name "sitemap.org" dir)))))
  116. ;; Site-map file name is controlled with `:sitemap-filename'.
  117. (should
  118. (org-test-publish
  119. '(:auto-sitemap t :sitemap-filename "mysitemap.org")
  120. (lambda (dir) (file-exists-p (expand-file-name "mysitemap.org" dir)))))
  121. ;; Site-map title is controlled with `:sitemap-title'. It defaults
  122. ;; to the project name.
  123. (should
  124. (equal "#+TITLE: Sitemap for project test"
  125. (org-test-publish
  126. '(:auto-sitemap t)
  127. (lambda (dir)
  128. (with-temp-buffer
  129. (insert-file-contents (expand-file-name "sitemap.org" dir))
  130. (buffer-substring (point) (line-end-position)))))))
  131. (should
  132. (equal "#+TITLE: My title"
  133. (org-test-publish
  134. '(:auto-sitemap t :sitemap-title "My title")
  135. (lambda (dir)
  136. (with-temp-buffer
  137. (insert-file-contents (expand-file-name "sitemap.org" dir))
  138. (buffer-substring (point) (line-end-position)))))))
  139. ;; Allowed site-map styles: `list' and `tree'.
  140. (should
  141. (equal "
  142. - [[file:a.org][A]]
  143. - [[file:b.org][b]]
  144. - [[file:sub/c.org][C]]"
  145. (org-test-publish
  146. '(:auto-sitemap t
  147. :sitemap-sort-folders ignore
  148. :sitemap-style list
  149. :exclude "."
  150. :include ("a.org" "b.org" "sub/c.org"))
  151. (lambda (dir)
  152. (with-temp-buffer
  153. (insert-file-contents (expand-file-name "sitemap.org" dir))
  154. (buffer-substring (line-beginning-position 2) (point-max)))))))
  155. (should
  156. (equal "
  157. - [[file:a.org][A]]
  158. - [[file:b.org][b]]
  159. - sub
  160. - [[file:sub/c.org][C]]"
  161. (org-test-publish
  162. '(:auto-sitemap t
  163. :sitemap-style tree
  164. :exclude "."
  165. :include ("a.org" "b.org" "sub/c.org"))
  166. (lambda (dir)
  167. (with-temp-buffer
  168. (insert-file-contents (expand-file-name "sitemap.org" dir))
  169. (buffer-substring (line-beginning-position 2) (point-max)))))))
  170. ;; When style is `list', `:sitemap-sort-folders' controls the order
  171. ;; of appearance of directories among published files.
  172. (should
  173. (equal
  174. "
  175. - sub/
  176. - [[file:a.org][A]]
  177. - [[file:sub/c.org][C]]"
  178. (org-test-publish
  179. '(:auto-sitemap t
  180. :recursive t
  181. :sitemap-style list
  182. :sitemap-sort-folders first
  183. :exclude "."
  184. :include ("a.org" "sub/c.org"))
  185. (lambda (dir)
  186. (with-temp-buffer
  187. (insert-file-contents (expand-file-name "sitemap.org" dir))
  188. (buffer-substring (line-beginning-position 2) (point-max)))))))
  189. (should
  190. (equal
  191. "
  192. - [[file:a.org][A]]
  193. - [[file:sub/c.org][C]]
  194. - sub/"
  195. (org-test-publish
  196. '(:auto-sitemap t
  197. :recursive t
  198. :sitemap-style list
  199. :sitemap-sort-folders last
  200. :exclude "."
  201. :include ("a.org" "sub/c.org"))
  202. (lambda (dir)
  203. (with-temp-buffer
  204. (insert-file-contents (expand-file-name "sitemap.org" dir))
  205. (buffer-substring (line-beginning-position 2) (point-max)))))))
  206. ;; When style is `list', `:sitemap-sort-folders' can be used to
  207. ;; toggle visibility of directories in the site-map.
  208. (should
  209. (let ((case-fold-search t))
  210. (string-match-p
  211. "- sub/$"
  212. (org-test-publish
  213. '(:auto-sitemap t
  214. :recursive t
  215. :sitemap-style list
  216. :sitemap-sort-folders t
  217. :exclude "."
  218. :include ("a.org" "sub/c.org"))
  219. (lambda (dir)
  220. (with-temp-buffer
  221. (insert-file-contents (expand-file-name "sitemap.org" dir))
  222. (buffer-substring (line-beginning-position 2) (point-max))))))))
  223. (should-not
  224. (string-match-p
  225. "- sub/$"
  226. (org-test-publish
  227. '(:auto-sitemap t
  228. :recursive t
  229. :sitemap-style list
  230. :sitemap-sort-folders ignore
  231. :exclude "."
  232. :include ("a.org" "sub/c.org"))
  233. (lambda (dir)
  234. (with-temp-buffer
  235. (insert-file-contents (expand-file-name "sitemap.org" dir))
  236. (buffer-substring (line-beginning-position 2) (point-max)))))))
  237. ;; Using `:sitemap-sort-files', files can be sorted alphabetically
  238. ;; (according to their title, or file name when there is none),
  239. ;; chronologically a anti-chronologically.
  240. (should
  241. (equal
  242. "
  243. - [[file:a.org][A]]
  244. - [[file:b.org][b]]
  245. - [[file:sub/c.org][C]]"
  246. (org-test-publish
  247. '(:auto-sitemap t
  248. :recursive t
  249. :sitemap-style list
  250. :sitemap-sort-folders ignore
  251. :sitemap-sort-files alphabetically
  252. :exclude "."
  253. :include ("a.org" "b.org" "sub/c.org"))
  254. (lambda (dir)
  255. (with-temp-buffer
  256. (insert-file-contents (expand-file-name "sitemap.org" dir))
  257. (buffer-substring (line-beginning-position 2) (point-max)))))))
  258. (should
  259. (equal
  260. "
  261. - [[file:b.org][b]]
  262. - [[file:sub/c.org][C]]
  263. - [[file:a.org][A]]"
  264. (org-test-publish
  265. '(:auto-sitemap t
  266. :recursive t
  267. :sitemap-style list
  268. :sitemap-sort-folders ignore
  269. :sitemap-sort-files chronologically
  270. :exclude "."
  271. :include ("a.org" "b.org" "sub/c.org"))
  272. (lambda (dir)
  273. (with-temp-buffer
  274. (insert-file-contents (expand-file-name "sitemap.org" dir))
  275. (buffer-substring (line-beginning-position 2) (point-max)))))))
  276. (should
  277. (equal
  278. "
  279. - [[file:a.org][A]]
  280. - [[file:sub/c.org][C]]
  281. - [[file:b.org][b]]"
  282. (org-test-publish
  283. '(:auto-sitemap t
  284. :recursive t
  285. :sitemap-style list
  286. :sitemap-sort-folders ignore
  287. :sitemap-sort-files anti-chronologically
  288. :exclude "."
  289. :include ("a.org" "b.org" "sub/c.org"))
  290. (lambda (dir)
  291. (with-temp-buffer
  292. (insert-file-contents (expand-file-name "sitemap.org" dir))
  293. (buffer-substring (line-beginning-position 2) (point-max)))))))
  294. ;; `:sitemap-format-entry' formats entries in the site-map whereas
  295. ;; `:sitemap-function' controls the full site-map.
  296. (should
  297. (equal "
  298. - a.org"
  299. (org-test-publish
  300. '(:auto-sitemap t
  301. :exclude "."
  302. :include ("a.org")
  303. :sitemap-format-entry
  304. (lambda (f _s _p) f))
  305. (lambda (dir)
  306. (with-temp-buffer
  307. (insert-file-contents (expand-file-name "sitemap.org" dir))
  308. (buffer-substring (line-beginning-position 2) (point-max)))))))
  309. (should
  310. (equal "Custom!"
  311. (org-test-publish
  312. '(:auto-sitemap t
  313. :exclude "."
  314. :include ("a.org")
  315. :sitemap-function (lambda (_title _f) "Custom!"))
  316. (lambda (dir)
  317. (with-temp-buffer
  318. (insert-file-contents (expand-file-name "sitemap.org" dir))
  319. (buffer-string))))))
  320. (should
  321. (equal "[[file:a.org][A]]"
  322. (org-test-publish
  323. '(:auto-sitemap t
  324. :exclude "."
  325. :include ("a.org")
  326. :sitemap-function
  327. (lambda (_title f) (org-list-to-generic f nil)))
  328. (lambda (dir)
  329. (with-temp-buffer
  330. (insert-file-contents (expand-file-name "sitemap.org" dir))
  331. (buffer-string)))))))
  332. ;;; Cross references
  333. (ert-deftest test-org-publish/resolve-external-link ()
  334. "Test `org-publish-resolve-external-link' specifications."
  335. ;; Function should preserve internal reference when used between
  336. ;; published files.
  337. (should
  338. (apply
  339. #'equal
  340. (let* (;; (ids nil)
  341. (backend
  342. (org-export-create-backend
  343. :transcoders
  344. `((headline . ,(lambda (h c i)
  345. (concat (org-export-get-reference h i) " " c)))
  346. (paragraph . ,(lambda (_p c _i) c))
  347. (section . ,(lambda (_s c _i) c))
  348. (link . ,(lambda (l _c _i)
  349. (let ((option (org-element-property :search-option l))
  350. (path (org-element-property :path l)))
  351. (and option
  352. (org-publish-resolve-external-link
  353. option path))))))))
  354. (publish
  355. (lambda (plist filename pub-dir)
  356. (org-publish-org-to backend filename ".test" plist pub-dir))))
  357. (org-test-publish
  358. (list :publishing-function (list publish))
  359. (lambda (dir)
  360. (cl-subseq
  361. (split-string
  362. (mapconcat (lambda (f) (org-file-contents (expand-file-name f dir)))
  363. (directory-files dir nil "\\.test\\'")
  364. " "))
  365. 1 3))))))
  366. ;; When optional argument PREFER-CUSTOM is non-nil, use custom ID
  367. ;; instead of internal reference, whenever possible.
  368. (should
  369. (equal
  370. '("a1" "b1")
  371. (let* ((ids nil)
  372. (link-transcoder
  373. (lambda (l _c _i)
  374. (let ((option (org-element-property :search-option l))
  375. (path (org-element-property :path l)))
  376. (push (org-publish-resolve-external-link option path t)
  377. ids)
  378. "")))
  379. (backend
  380. (org-export-create-backend
  381. :transcoders `((headline . (lambda (h c i) c))
  382. (paragraph . (lambda (p c i) c))
  383. (section . (lambda (s c i) c))
  384. (link . ,link-transcoder))))
  385. (publish
  386. (lambda (plist filename pub-dir)
  387. (org-publish-org-to backend filename ".test" plist pub-dir))))
  388. (org-test-publish (list :publishing-function (list publish)
  389. :exclude "."
  390. :include '("a.org" "b.org"))
  391. #'ignore)
  392. (sort ids #'string<)))))
  393. ;;; Tools
  394. (ert-deftest test-org-publish/get-project-from-filename ()
  395. "Test `org-publish-get-project-from-filename' specifications."
  396. ;; Check base directory.
  397. (should
  398. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  399. (file (expand-file-name "a.org" base))
  400. (org-publish-project-alist `(("p" :base-directory ,base))))
  401. (org-publish-get-project-from-filename file)))
  402. ;; Return nil if no appropriate project is found.
  403. (should-not
  404. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  405. ;; (file (expand-file-name "a.org" base))
  406. (org-publish-project-alist `(("p" :base-directory ,base))))
  407. (org-publish-get-project-from-filename "/other/file.org")))
  408. ;; Return the first project effectively publishing the provided
  409. ;; file.
  410. (should
  411. (equal "p2"
  412. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  413. (file (expand-file-name "a.org" base))
  414. (org-publish-project-alist
  415. `(("p1" :base-directory "/other/")
  416. ("p2" :base-directory ,base)
  417. ("p3" :base-directory ,base))))
  418. (car (org-publish-get-project-from-filename file)))))
  419. ;; When :recursive in non-nil, allow files in sub-directories.
  420. (should
  421. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  422. (file (expand-file-name "sub/c.org" base))
  423. (org-publish-project-alist
  424. `(("p" :base-directory ,base :recursive t))))
  425. (org-publish-get-project-from-filename file)))
  426. (should-not
  427. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  428. (file (expand-file-name "sub/c.org" base))
  429. (org-publish-project-alist
  430. `(("p" :base-directory ,base :recursive nil))))
  431. (org-publish-get-project-from-filename file)))
  432. ;; Also, when :recursive is non-nil, follow symlinks to directories.
  433. (should
  434. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  435. (file (expand-file-name "link/link.org" base))
  436. (org-publish-project-alist
  437. `(("p" :base-directory ,base :recursive t))))
  438. (org-publish-get-project-from-filename file)))
  439. (should-not
  440. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  441. (file (expand-file-name "link/link.org" base))
  442. (org-publish-project-alist
  443. `(("p" :base-directory ,base :recursive nil))))
  444. (org-publish-get-project-from-filename file)))
  445. ;; Check :base-extension.
  446. (should
  447. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  448. (file (expand-file-name "file.txt" base))
  449. (org-publish-project-alist
  450. `(("p" :base-directory ,base :base-extension "txt"))))
  451. (org-publish-get-project-from-filename file)))
  452. (should-not
  453. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  454. (file (expand-file-name "file.txt" base))
  455. (org-publish-project-alist
  456. `(("p" :base-directory ,base :base-extension "org"))))
  457. (org-publish-get-project-from-filename file)))
  458. ;; When :base-extension has the special value `any', allow any
  459. ;; extension, including none.
  460. (should
  461. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  462. (file (expand-file-name "file.txt" base))
  463. (org-publish-project-alist
  464. `(("p" :base-directory ,base :base-extension any))))
  465. (org-publish-get-project-from-filename file)))
  466. (should
  467. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  468. (file (expand-file-name "noextension" base))
  469. (org-publish-project-alist
  470. `(("p" :base-directory ,base :base-extension any))))
  471. (org-publish-get-project-from-filename file)))
  472. ;; Pathological case: Handle both :extension any and :recursive t.
  473. (should
  474. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  475. (file (expand-file-name "sub/c.org" base))
  476. (org-publish-project-alist
  477. `(("p" :base-directory ,base :recursive t :base-extension any))))
  478. (org-publish-get-base-files (org-publish-get-project-from-filename file))))
  479. ;; Check :exclude property.
  480. (should-not
  481. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  482. (file (expand-file-name "a.org" base))
  483. (org-publish-project-alist
  484. `(("p" :base-directory ,base :exclude "a"))))
  485. (org-publish-get-project-from-filename file)))
  486. (should
  487. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  488. (file (expand-file-name "a.org" base))
  489. (org-publish-project-alist
  490. `(("p" :base-directory ,base :exclude "other"))))
  491. (org-publish-get-project-from-filename file)))
  492. ;; The regexp matches against relative file name, not absolute one.
  493. (should
  494. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  495. (file (expand-file-name "a.org" base))
  496. (org-publish-project-alist
  497. `(("p" :base-directory ,base :exclude "examples/pub"))))
  498. (org-publish-get-project-from-filename file)))
  499. ;; Check :include property.
  500. (should
  501. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  502. (file (expand-file-name "file.txt" base))
  503. (org-publish-project-alist
  504. `(("p" :base-directory ,base :include (,file)))))
  505. (org-publish-get-project-from-filename file)))
  506. ;; :include property has precedence over :exclude one.
  507. (should
  508. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  509. (file (expand-file-name "a.org" base))
  510. (org-publish-project-alist
  511. `(("p"
  512. :base-directory ,base
  513. :include (,(file-name-nondirectory file))
  514. :exclude "a"))))
  515. (org-publish-get-project-from-filename file)))
  516. ;; With optional argument, return a meta-project publishing provided
  517. ;; file.
  518. (should
  519. (equal "meta"
  520. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  521. (file (expand-file-name "a.org" base))
  522. (org-publish-project-alist
  523. `(("meta" :components ("p"))
  524. ("p" :base-directory ,base))))
  525. (car (org-publish-get-project-from-filename file t))))))
  526. (ert-deftest test-org-publish/file-relative-name ()
  527. "Test `org-publish-file-relative-name' specifications."
  528. ;; Turn absolute file names into relative ones if file belongs to
  529. ;; base directory.
  530. (should
  531. (equal "a.org"
  532. (let* ((base (expand-file-name "examples/pub/" org-test-dir))
  533. (file (expand-file-name "a.org" base)))
  534. (org-publish-file-relative-name file `(:base-directory ,base)))))
  535. (should
  536. (equal "pub/a.org"
  537. (let* ((base (expand-file-name "examples/" org-test-dir))
  538. (file (expand-file-name "pub/a.org" base)))
  539. (org-publish-file-relative-name file `(:base-directory ,base)))))
  540. ;; Absolute file names that do not belong to base directory are
  541. ;; unchanged.
  542. (should
  543. (equal "/name.org"
  544. (let ((base (expand-file-name "examples/pub/" org-test-dir)))
  545. (org-publish-file-relative-name "/name.org"
  546. `(:base-directory ,base)))))
  547. ;; Relative file names are unchanged.
  548. (should
  549. (equal "a.org"
  550. (let ((base (expand-file-name "examples/pub/" org-test-dir)))
  551. (org-publish-file-relative-name "a.org" `(:base-directory ,base))))))
  552. (provide 'test-ox-publish)
  553. ;;; test-ox-publish.el ends here