From ffb1bd55d6339c1b93926a619b208ea1f490d8b5 Mon Sep 17 00:00:00 2001 From: Justin Barclay Date: Thu, 2 May 2024 13:45:53 -0700 Subject: [PATCH] fix: testing harness track-changes is not signalled in the middle of our tests so we must signal it ourselves --- Makefile | 2 +- test/test-helper.el | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 14652e9..9f42cee 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ version: download: ifeq (,$(wildcard $(HOME)/.emacs.d/parinfer-rust/parinfer-rust-$(OS).so)) mkdir -p $(HOME)/.emacs.d/parinfer-rust - curl -L "https://github.com/justinbarclay/parinfer-rust/releases/download/v0.4.4/parinfer-rust-$(OS).so" -o "$(HOME)/.emacs.d/parinfer-rust/parinfer-rust-$(OS).so" + curl -L "https://github.com/justinbarclay/parinfer-rust/releases/download/v0.4.5/parinfer-rust-$(OS).so" -o "$(HOME)/.emacs.d/parinfer-rust/parinfer-rust-$(OS).so" endif test: clean elpa version download build diff --git a/test/test-helper.el b/test/test-helper.el index 446b41d..f4aec7c 100644 --- a/test/test-helper.el +++ b/test/test-helper.el @@ -166,6 +166,8 @@ extracted from the json-alist." (setq parinfer-rust--previous-options (parinfer-rust--generate-options (parinfer-rust-make-option) (parinfer-rust-make-changes)))) (move-cursor-to-current-position) + ;; Parinfer's change tracking system is not triggered, signaled, so we need to + ;; signal and call it ourselves (parinfer-rust--execute) (when remove-first-line ;; if we created a new line in move-cursor-current-position (progn ;; remove it @@ -199,11 +201,14 @@ extracted from the json-alist." (parinfer-rust-mode) (setq-local parinfer-rust--mode mode) (when changes - (mapc - 'apply-changes-in-buffer - changes)) + (progn + (mapc + 'apply-changes-in-buffer + changes))) + ;; Parinfer's change tracking system is not triggered, signaled, so we need to signal and call it ourselves + (parinfer-rust--fetch-changes parinfer-rust--change-tracker) (move-cursor-to-current-position) - (parinfer-rust--execute) ;; Parinfer execute doesn't run after apply-changes so we have to call in manually + (parinfer-rust--execute) (parinfer-rust-mode) (when remove-first-line (progn @@ -237,6 +242,8 @@ extracted from the json-alist." (forward-line (1- lineNo)) (forward-char column) (apply command nil) + ;; Parinfer's change tracking system is not triggered, signaled, so we need to signal and call it ourselves + (parinfer-rust--fetch-changes parinfer-rust--change-tracker) (parinfer-rust--execute))) (setq parinfer-result-string (buffer-substring-no-properties (point-min) (point-max))) ;; Save the string before we kill our current buffer (switch-to-buffer current)