mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-26 14:02:55 +00:00
* testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1) (test-ob/just-one-results-block) (test-ob/org-babel-remove-result--results-default) (test-ob/specific-colnames): Fix tests. * testing/lisp/test-ob-tangle.el (ob-tangle/comment-links-at-left-margin): Ditto. * testing/lisp/test-ob-shell.el (ob-shell/generic-uses-no-arrays) (ob-shell/bash-uses-arrays) (ob-shell/generic-uses-no-assoc-arrays) (ob-shell/bash-uses-assoc-arrays, ob-shell/simple-list): Ditto. * testing/lisp/test-ob-exp.el (ob-exp/exports-inline) (ob-exp/exports-inline-code): Ditto. * testing/examples/ob-shell-test.org (Generic shell: no arrays) (Bash shell: support for arrays) (Generic shell: no special handing) (Bash shell: support for associative arrays) (Generic shell: no special handing) (Bash shell: support for associative arrays with lists): Ditto.
2.2 KiB
2.2 KiB
a collection of examples for ob-shell tests
- Sample data structures
- Array tests
- Associative array tests (simple map)
- Associative array tests (more than 2 columns)
Sample data structures
one |
two |
three |
first | one |
second | two |
third | three |
bread | 2 | kg |
spaghetti | 20 | cm |
milk | 50 | dl |
Array tests
Generic shell: no arrays
one two three
Bash shell: support for arrays
Bash will see a simple indexed array. In this test, we check that the returned value is indeed only the first item of the array, as opposed to the generic serialiation that will return all elements of the array as a single string.
one
Associative array tests (simple map)
Generic shell: no special handing
The shell will see all values as a single string.
first one second two third three
Bash shell: support for associative arrays
Bash will see a table that contains the first column as the 'index' of the associative array, and the second column as the value.
echo ${table[second]}
two
Associative array tests (more than 2 columns)
Generic shell: no special handing
bread 2 kg spaghetti 20 cm milk 50 dl
Bash shell: support for associative arrays with lists
Bash will see an associative array that contains each row as a single string. Bash cannot handle lists in associative arrays.
20 cm