Test support of explicitly specified colnames

* test-ob.el (test-ob/specific-colnames): Add test checking that given column
names are well present in the output table.
This commit is contained in:
Sebastien Vauban 2013-04-25 15:24:58 +02:00 committed by Eric Schulte
parent 2af471d7cf
commit bc8b8fbcf0
1 changed files with 32 additions and 0 deletions

View File

@ -1106,6 +1106,38 @@ Paragraph"
(widen)
(should (should (re-search-forward "^: 3" nil t)))))
(ert-deftest test-ob/specific-colnames ()
"Test passing specific column names."
(should
(equal "#+name: input-table
| id | var1 |
|----+------|
| 1 | bar |
| 2 | baz |
#+begin_src sh :var data=input-table :exports results :colnames '(Rev Author)
echo \"$data\"
#+end_src
#+results:
| Rev | Author |
|-----+--------|
| 1 | bar |
| 2 | baz |
"
(org-test-with-temp-text "#+name: input-table
| id | var1 |
|----+------|
| 1 | bar |
| 2 | baz |
#+begin_src sh :var data=input-table :exports results :colnames '(Rev Author)
echo \"$data\"
#+end_src
"
(org-babel-execute-src-block)
(buffer-string)))))
(provide 'test-ob)