diff options
author | mattkae <mattkae@protonmail.com> | 2022-06-07 08:23:47 -0400 |
---|---|---|
committer | mattkae <mattkae@protonmail.com> | 2022-06-07 08:23:47 -0400 |
commit | bd18a38c2898548a3664a9ddab9f79c84f2caf4a (patch) | |
tree | 95b9933376770381bd8859782ae763be81c2d72b /elpa/ac-js2-20190101.933/ac-js2-tests.el | |
parent | b07628dddf418d4f47b858e6c35fd3520fbaeed2 (diff) | |
parent | ef160dea332af4b4fe5e2717b962936c67e5fe9e (diff) |
Merge conflict
Diffstat (limited to 'elpa/ac-js2-20190101.933/ac-js2-tests.el')
-rw-r--r-- | elpa/ac-js2-20190101.933/ac-js2-tests.el | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/elpa/ac-js2-20190101.933/ac-js2-tests.el b/elpa/ac-js2-20190101.933/ac-js2-tests.el deleted file mode 100644 index 05514e3..0000000 --- a/elpa/ac-js2-20190101.933/ac-js2-tests.el +++ /dev/null @@ -1,76 +0,0 @@ -;;; Tests for ac-js2 - -(require 'ert) -(require 'skewer-mode) -(require 'js2-mode) -(require 'ac-js2) - -;;; Must have a skewer client connected before running the tests -;; Need to call httpd-stop from main Emacs if running tests in batch mode -(unless skewer-clients - (run-skewer)) - -(ert-deftest ac-js2-candidates-test () - "Test the major function that returns candidates for all frontends." - (let (property - property-dot - func-call - var) - (with-temp-buffer - (insert " - var temp = function(param1, param2) { - var localParam = 15; - return param1 + param2; - }; - - var look; - -temp.aFun = function(lolParam) {}; -temp.anotherFunction = function() { return {about: 3};}") - (setq ac-js2-evaluate-calls t) - (setq ac-js2-external-libraries nil) - - (js2-mode) - (ac-js2-mode t) - (js2-parse) - - (insert "tem") - (ac-js2-candidates) - (setq var ac-js2-skewer-candidates) - (delete-char -3) - - (insert "temp.") - (js2-parse) - (ac-js2-candidates) - (setq property-dot ac-js2-skewer-candidates) - (delete-char -5) - - (insert "temp.aF") - (js2-parse) - (ac-js2-candidates) - (setq property ac-js2-skewer-candidates)) - - (should (assoc 'anotherFunction property-dot)) - (print property) - (should (assoc 'aFun property)) - (should (assoc 'temp var)))) - -(defmacro completion-frontend-test (test-name completion-function) - "Utility for testing completion front ends. -TODO: cover more cases" - `(ert-deftest ,test-name () - (let (var) - (with-temp-buffer - (insert "var testComplete = function(param1, param2) {};") - - (js2-mode) - (ac-js2-mode t) - (js2-parse) - - (insert "testComplet") - (funcall ',completion-function) - (setq var (thing-at-point 'word))) - (should (string= var "testComplete"))))) - -(completion-frontend-test auto-complete-test auto-complete) -(completion-frontend-test completion-at-point-test completion-at-point) |