diff --git a/img/gptel.png b/img/gptel.png deleted file mode 100755 index 146caea..0000000 Binary files a/img/gptel.png and /dev/null differ diff --git a/test/test-gptel-org.el b/test/test-gptel-org.el new file mode 100644 index 0000000..8ecc689 --- /dev/null +++ b/test/test-gptel-org.el @@ -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 + +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))))) +