summaryrefslogtreecommitdiff
path: root/llm-tools-hl-test.el
diff options
context:
space:
mode:
Diffstat (limited to 'llm-tools-hl-test.el')
-rw-r--r--llm-tools-hl-test.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/llm-tools-hl-test.el b/llm-tools-hl-test.el
index d008491..879a4b4 100644
--- a/llm-tools-hl-test.el
+++ b/llm-tools-hl-test.el
@@ -665,3 +665,18 @@
665 (let ((op (car (llm-tools--hl-parse-section section)))) 665 (let ((op (car (llm-tools--hl-parse-section section))))
666 (should (eq (hl-op-type op) 'insert-before)) 666 (should (eq (hl-op-type op) 'insert-before))
667 (should (string= (hl-op-anchor op) "BOF"))))) 667 (should (string= (hl-op-anchor op) "BOF")))))
668
669(ert-deftest llm-tools--hl-get-anchors-with-payload-lines-test ()
670 "Test that payload lines (~) are ignored during anchor extraction.
671This would have caught the args-out-of-range crash when anchor extraction
672tried to parse a line like \"~payload\" as an operation."
673 (let ((patch "@@ test.el\n+ 4ei\n~some payload\n~another line\n= 3gv..6be\n~replacement"))
674 (let ((anchors (llm-tools--hl-get-anchors patch)))
675 (should (= (length anchors) 1))
676 (let ((file-anchors (cdr (car anchors))))
677 (should (member "4ei" file-anchors))
678 (should (member "3gv" file-anchors))
679 (should (member "6be" file-anchors))
680 (should-not (member "some payload" file-anchors))
681 (should-not (member "another line" file-anchors))
682 (should-not (member "replacement" file-anchors))))))