test-gptel-org: Add markdown conversion tests
* test/test-gptel-org.el (test--gptel-convert-markdown->org, test--gptel--stream-convert-markdown->org): Add tests Also remove out-of-date demo image.
This commit is contained in:
parent
3935a6dcf8
commit
d502ad8ecb
2 changed files with 32 additions and 0 deletions
BIN
img/gptel.png
BIN
img/gptel.png
Binary file not shown.
Before Width: | Height: | Size: 230 KiB |
32
test/test-gptel-org.el
Normal file
32
test/test-gptel-org.el
Normal file
|
@ -0,0 +1,32 @@
|
|||
;; -*- lexical-binding: t; -*-
|
||||
(require 'ert)
|
||||
(require 'gptel)
|
||||
|
||||
(let ((string-sequence
|
||||
'("" "```" "cpp" "
|
||||
" "#include" " <" "cstdio" ">
|
||||
|
||||
" "int" " main" "()" " {
|
||||
" " " " printf" "(\"" "``" "``" "`" "\n" "\");
|
||||
" " " " return" " " "0" ";
|
||||
" "}
|
||||
" "```"))
|
||||
(converted-sequence
|
||||
"#+begin_src cpp
|
||||
#include <cstdio>
|
||||
|
||||
int main() {
|
||||
printf(\"`````\n\");
|
||||
return 0;
|
||||
}
|
||||
#+end_src"))
|
||||
(ert-deftest test--gptel--convert-markdown->org ()
|
||||
(should (string= (gptel--convert-markdown->org (apply #'concat string-sequence))
|
||||
converted-sequence)))
|
||||
|
||||
(ert-deftest test--gptel--stream-convert-markdown->org ()
|
||||
(let ((func (gptel--stream-convert-markdown->org)))
|
||||
(should
|
||||
(string= (apply #'concat (mapcar func string-sequence))
|
||||
converted-sequence)))))
|
||||
|
Loading…
Add table
Reference in a new issue