|
1 |
| -;; [[file:init.org::*Word Completion and Documentation Pop-ups][Word Completion and Documentation Pop-ups:2]] |
2 |
| -(ert-deftest company-works-as-expected-in-text-mode () |
3 |
| - :tags '(company) |
4 |
| - (switch-to-buffer "*TESTING COMPANY MODE ~ Text*") |
5 |
| - |
6 |
| - ;; Ensure we have a clear buffer, and enter some text. (Namely, Python code). |
7 |
| - (erase-buffer) |
8 |
| - (insert "\n def first(x): pass") |
9 |
| - (insert "\n def fierce(a, b): pass") |
10 |
| - |
11 |
| - ;; Completion anything mode is enabled by default. |
12 |
| - (should company-mode) |
13 |
| - |
14 |
| - ;; There are 2 completion candidates: The two we wrote. |
15 |
| - (insert "\n fi") |
16 |
| - (company-manual-begin) ;; i.e., C-/ |
17 |
| - (should (equal company-candidates '("fierce" "first"))) |
18 |
| - |
19 |
| - ;; [fi ↦ fierce] Default option is the most recently matching written word. |
20 |
| - (insert "\n fi") |
21 |
| - (execute-kbd-macro (kbd "C-/ <return>")) |
22 |
| - (should (looking-back "fierce")) |
23 |
| - |
24 |
| - ;; [fi ↦ first] We can use M-2 to select the candidate “first” |
25 |
| - (insert "\n fi") |
26 |
| - (execute-kbd-macro (kbd "C-/ M-2")) |
27 |
| - (should (looking-back "first")) |
28 |
| - |
29 |
| - (kill-buffer)) |
30 |
| - |
31 |
| -;; Let's enter Python mode and see how things change |
32 |
| - |
33 |
| -(ert-deftest company-shows-keywords-alongside-completions-alphabetically () |
34 |
| - :tags '(company) |
35 |
| - (switch-to-buffer "*TESTING COMPANY MODE ~ Python*") |
36 |
| - (python-mode) |
37 |
| - |
38 |
| - ;; Ensure we have a clear buffer, and enter some text. (Namely, Python code). |
39 |
| - (erase-buffer) |
40 |
| - (insert "\n def first(x): pass") |
41 |
| - (insert "\n def fierce(a, b): pass") |
42 |
| - |
43 |
| - ;; There are 3 completion candidates: The two we wrote, & the third being a Python keyword. |
44 |
| - (insert "\n fi") |
45 |
| - (company-manual-begin) |
46 |
| - (should (equal company-candidates '("fierce" "first" #("finally" 0 7 (company-backend company-keywords))))) |
47 |
| - |
48 |
| - ;; Candidates are shown alphabetically: M-2 yields “finally”. |
49 |
| - (execute-kbd-macro (kbd "C-g C-/ M-2")) ;; Quit and restart the completion, to get to starting position, then M-2. |
50 |
| - (should (looking-back "finally")) |
51 |
| - |
52 |
| - (kill-buffer)) |
53 |
| -;; Word Completion and Documentation Pop-ups:2 ends here |
54 |
| - |
55 |
| -;; [[file:init.org::*E2E Test][E2E Test:1]] |
| 1 | +;; [[file:init.org::#E2E-Test][E2E Test:1]] |
56 | 2 | (ert-deftest hideshow-is-enabled-and-folds-by-default ()
|
57 | 3 | :tags '(hideshow)
|
58 | 4 | ;; Make a temporary scratch.js file with the given contents.
|
|
0 commit comments