64 lines
1.6 KiB
Org Mode
64 lines
1.6 KiB
Org Mode
#+Title: a collection of examples for ob-octave tests
|
|
#+OPTIONS: ^:nil
|
|
|
|
* Simple tests
|
|
:PROPERTIES:
|
|
:ID: 54dcd61d-cf6c-4d7a-b9e5-854953c8a753
|
|
:END:
|
|
Number output
|
|
#+begin_src octave :exports results :results silent
|
|
ans = 10
|
|
#+end_src
|
|
|
|
Array output
|
|
#+begin_src octave :exports results :results silent
|
|
ans = 1:4'
|
|
#+end_src
|
|
|
|
* Input tests
|
|
:PROPERTIES:
|
|
:ID: cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba
|
|
:END:
|
|
Input an integer variable
|
|
#+begin_src octave :exports results :results silent :var s=42
|
|
ans = s
|
|
#+end_src
|
|
|
|
Input an array
|
|
#+begin_src octave :exports results :results silent :var s='(1.0 2.0 3.0)
|
|
ans = s
|
|
#+end_src
|
|
|
|
Input a matrix
|
|
#+begin_src octave :exports results :results silent :var s='((1 2) (3 4))
|
|
ans = s
|
|
#+end_src
|
|
|
|
Input a string
|
|
#+begin_src octave :exports results :results silent :var s="test"
|
|
ans = s(1:2)
|
|
#+end_src
|
|
|
|
Input elisp nil
|
|
#+begin_src octave :exports results :results silent :var s='nil
|
|
ans = s
|
|
#+end_src
|
|
|
|
|
|
* Graphical tests
|
|
|
|
Graphics file. This test is performed by =ob-octave/graphics-file= in =testing/lisp/test-ob-octave.el=.
|
|
#+begin_src octave :results file graphics :file sombrero.png
|
|
sombrero;
|
|
#+end_src
|
|
|
|
Graphics file in a session. This test is performed by =ob-octave/graphics-file-session= in =testing/lisp/test-ob-octave.el=.
|
|
#+begin_src octave :session :results graphics file :file sombrero.png
|
|
sombrero;
|
|
#+end_src
|
|
|
|
Graphics file with a space in name. This test is performed by =ob-octave/graphics-file-space= in =testing/lisp/test-ob-octave.el=.
|
|
#+begin_src octave :results graphics file :file sombrero hat.png
|
|
sombrero;
|
|
#+end_src
|