branch: externals/ellama
commit a9df94958677e83be760f10a71173db345d61d8e
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>
Add integration tests for Ellama
Added new integration test file `integration-test-ellama.el` with
tests for `ellama-extract-string-list` and
`ellama-semantic-similar-p`. Updated copyright year in
`test-ellama.el`.
---
tests/integration-test-ellama.el | 50 ++++++++++++++++++++++++++++++++++++++++
tests/test-ellama.el | 2 +-
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/tests/integration-test-ellama.el b/tests/integration-test-ellama.el
new file mode 100644
index 0000000000..23334e1bd5
--- /dev/null
+++ b/tests/integration-test-ellama.el
@@ -0,0 +1,50 @@
+;;; integration-test-ellama.el --- Ellama integration tests -*-
lexical-binding: t; package-lint-main-file: "../ellama.el"; -*-
+
+;; Copyright (C) 2023-2025 Free Software Foundation, Inc.
+
+;; Author: Sergey Kostyaev <[email protected]>
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Ellama tests.
+;;
+
+;;; Code:
+
+(ert-deftest ellama-extract-sting-list-test ()
+ "Check if `ellama-extract-string-list' works correctly."
+ (should (equal-including-properties
+ (ellama-extract-string-list
+ "fruits"
+ "Here is the fruits: apple, banana, dragon fruit. I like it.")
+ '("apple" "banana" "dragon fruit"))))
+
+(ert-deftest ellama-semantic-similar-test ()
+ "Check if `ellama-semantic-similar-p' works correctly."
+ (should (equal-including-properties
+ (let ((res))
+ (dolist (el '("How many r's in strawberry?"
+ "How many times letter r appears in word strawberry?"
+ "How many r's in strawberry?"
+ "How many times letter e appears in word
strawberry?"))
+ (cl-pushnew el res :test #'ellama-semantic-similar-p))
+ (reverse res))
+ '("How many r's in strawberry?"
+ "How many times letter e appears in word strawberry?"))))
+
+(provide 'integration-test-ellama)
+
+;;; integration-test-ellama.el ends here
diff --git a/tests/test-ellama.el b/tests/test-ellama.el
index 39af77314a..8c93f6ee03 100644
--- a/tests/test-ellama.el
+++ b/tests/test-ellama.el
@@ -1,6 +1,6 @@
;;; test-ellama.el --- Ellama tests -*- lexical-binding: t;
package-lint-main-file: "../ellama.el"; -*-
-;; Copyright (C) 2023 Free Software Foundation, Inc.
+;; Copyright (C) 2023-2025 Free Software Foundation, Inc.
;; Author: Sergey Kostyaev <[email protected]>