emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob 9a33661bec7aa45879af0a3eab142ca7310237c8 3236 bytes (raw)
name: testing/examples/header_test.org 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 
#+TITLE: Header tests
#+PROPERTY: header-args :tangle /tmp/default_tangle.txt

The text contents in each block are tested against the output of
=(assoc <prop> (nth 2 (org-babel-get-src-block-info)))=

Multiple header properties can be tested by separating each property
output with a **newline followed by exactly two spaces**.

* Inherit tangle header from document
:PROPERTIES:
:ID:       a41c3238-f457-4769-b10b-8d50e9d386a1
:END:

#+begin_src conf
  (:tangle . /tmp/default_tangle.txt)
#+end_src

* Inherit tangle header but use local sync action
:PROPERTIES:
:ID:       debf7bf8-e5eb-412d-9127-57950a27c390
:END:

#+begin_src conf :tangle skip
  (:tangle . /tmp/default_tangle.txt skip)
#+end_src

* Use local tangle file and sync action
:PROPERTIES:
:ID:       1ca658c1-0dfd-42a5-bbe3-305582deeb00
:END:
+ Ignore document header completely.
#+begin_src conf :tangle randomfile sync
  (:tangle . randomfile sync)
#+end_src

* Use local tangle file and sync action 2
:PROPERTIES:
:header-args: :tangle "newfile.txt" import
:END:
** Subheading
:PROPERTIES:
:ID:       602503b8-6657-49c6-9cac-7edac396f725
:END:
+ Ignore document header and parent header completely.
#+begin_src conf :tangle randomfile sync
  (:tangle . randomfile sync)
#+end_src


* Test tangle and results param together
:PROPERTIES:
:ID:       4fb9938c-aec0-479f-bbc6-6b7a4228d9c2
:END:
#+begin_src conf  :tangle randomfile
  (:tangle . randomfile)
  (:results . replace)
#+end_src

* Inherit the tangle file name, take the last sync action
:PROPERTIES:
:ID:       7a98b56d-e59f-426d-bd58-f93bb22cf57b
:END:
+ Ignores import
#+begin_src conf  :tangle import export
  (:tangle . /tmp/default_tangle.txt export)
#+end_src

* Take the last local tangle file name and the last sync action
:PROPERTIES:
:ID:       cd85e03a-1a4c-45d5-ac33-90d96999b665
:END:
+ Ignores fname1 and sync
#+begin_src conf  :tangle fname1 fname2 sync export
  (:tangle . fname2 export)
#+end_src

* Merge document results param and local results param
:PROPERTIES:
:ID:       f4e4e422-029b-4ef7-b594-cd70cff2d943
:END:

#+begin_src sh :results file wrap
  (:results . wrap file replace)
  (:exports . code)
#+end_src

* All tangle headers should be ignored (ITS FAILING HERE)
:PROPERTIES:
:ID:       9715d355-009c-4188-8b97-bcbebaeee86f
:END:

#+begin_src conf :tangle no
  (:tangle . no)
#+end_src

* Tangle filename ignores document and heading args, inherits heading exports
:PROPERTIES:
:ID:       1a3b5565-27b5-450e-a2c5-7f95a8142f3b
:header-args: :tangle no :exports verbatim
:END:

#+begin_src conf :tangle "foo.txt" :comments link
  (:tangle . foo.txt)
  (:exports . verbatim code)
  (:comments . link)
#+end_src

* Heading tangle parameter is not overwritten by local "yes"
:PROPERTIES:
:ID:       fe54b2be-d9f1-40b4-83df-49501e69d083
:header-args: :tangle "foo.txt"
:END:
#+begin_src :tangle yes
   (:tangle . foo.txt)
#+end_src

** Local tangle filename with spaces overwrites parent foo.txt
:PROPERTIES:
:ID:       ab8af294-c586-4ec8-9f45-3c3baaeb184d
:END:
+ The expected hierarchy is =/tmp/default_tangle.txt= is supplanted by
  =foo.txt= which is supplanted by =file with spaces.txt=

#+begin_src :tangle "file with spaces.txt"
   (:tangle . "file with spaces.txt")
#+end_src

debug log:

solving 9a33661be ...
found 9a33661be in https://list.orgmode.org/orgmode/87a5y3vzpe.fsf@gmail.com/

applying [1/1] https://list.orgmode.org/orgmode/87a5y3vzpe.fsf@gmail.com/
diff --git a/testing/examples/header_test.org b/testing/examples/header_test.org
new file mode 100644
index 000000000..9a33661be

Checking patch testing/examples/header_test.org...
Applied patch testing/examples/header_test.org cleanly.

index at:
100644 9a33661bec7aa45879af0a3eab142ca7310237c8	testing/examples/header_test.org

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).