branch: master commit a4fafc32250bf4b3dba1bba8d38ab77703627935 Author: Noam Postavsky <npost...@users.sourceforge.net> Commit: Noam Postavsky <npost...@users.sourceforge.net>
Add test for loading snippet with same uuid * yasnippet-tests.el (snippet-load-uuid): New test. --- yasnippet-tests.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/yasnippet-tests.el b/yasnippet-tests.el index 1d56fb8..b0906d5 100644 --- a/yasnippet-tests.el +++ b/yasnippet-tests.el @@ -613,6 +613,24 @@ TODO: correct this bug!" (yas-reload-all) (yas--basic-jit-loading-1)))) +(ert-deftest snippet-load-uuid () + "Test snippets with same uuid override old ones." + (yas-saving-variables + (yas-define-snippets + 'text-mode + '(("1" "one" "one" nil nil nil nil "C-c 1" "uuid-1") + ("2" "two" "two" nil nil nil nil nil "uuid-2"))) + (with-temp-buffer + (text-mode) + (yas-minor-mode +1) + (should (equal (yas-lookup-snippet "one") "one")) + (should (eq (key-binding "\C-c1") 'yas-expand-from-keymap)) + (yas-define-snippets + 'text-mode '(("_1" "one!" "won" nil nil nil nil nil "uuid-1"))) + (should (null (yas-lookup-snippet "one" nil 'noerror))) + (should (null (key-binding "\C-c1"))) + (should (equal (yas-lookup-snippet "won") "one!"))))) + (ert-deftest visiting-compiled-snippets () "Test snippet visiting for compiled snippets." (yas-with-some-interesting-snippet-dirs