|
48 | 48 | (expect (inf-clojure--kw-to-symbol "::keyword") :to-equal "keyword")
|
49 | 49 | (expect (inf-clojure--kw-to-symbol nil) :to-equal nil)))
|
50 | 50 |
|
51 |
| -(describe "completion bounds at point" () |
| 51 | +(describe "completion bounds at point" |
52 | 52 | (it "computes bounds for plain-text"
|
53 |
| - (ict-with-assess-buffers |
54 |
| - ((a (insert "plain-text"))) |
55 |
| - (with-current-buffer a |
56 |
| - (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
57 |
| - :to-equal "plain-text")))) |
| 53 | + (ict-with-assess-buffers |
| 54 | + ((a (insert "plain-text"))) |
| 55 | + (with-current-buffer a |
| 56 | + (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 57 | + :to-equal "plain-text")))) |
58 | 58 |
|
59 | 59 | (it "computes bounds for @deref"
|
60 |
| - (ict-with-assess-buffers |
61 |
| - ((a (insert "@deref"))) |
62 |
| - (with-current-buffer a |
63 |
| - (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
64 |
| - :to-equal "deref")))) |
| 60 | + (ict-with-assess-buffers |
| 61 | + ((a (insert "@deref"))) |
| 62 | + (with-current-buffer a |
| 63 | + (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 64 | + :to-equal "deref")))) |
65 | 65 |
|
66 | 66 | (it "computes bounds for ^:keyword"
|
67 |
| - (ict-with-assess-buffers |
68 |
| - ((a (insert "^:keyword"))) |
69 |
| - (with-current-buffer a |
70 |
| - (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
71 |
| - :to-equal ":keyword")))) |
| 67 | + (ict-with-assess-buffers |
| 68 | + ((a (insert "^:keyword"))) |
| 69 | + (with-current-buffer a |
| 70 | + (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 71 | + :to-equal ":keyword")))) |
72 | 72 |
|
73 | 73 | (it "computes bounds for ::keyword"
|
74 |
| - (ict-with-assess-buffers |
75 |
| - ((a (insert "::keyword"))) |
76 |
| - (with-current-buffer a |
77 |
| - (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
78 |
| - :to-equal "::keyword")))) |
| 74 | + (ict-with-assess-buffers |
| 75 | + ((a (insert "::keyword"))) |
| 76 | + (with-current-buffer a |
| 77 | + (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 78 | + :to-equal "::keyword")))) |
79 | 79 |
|
80 | 80 | (it "computes bounds for [^:keyword (combined break chars and keyword)"
|
81 |
| - (ict-with-assess-buffers |
82 |
| - ((a (insert "[^:keyword"))) |
83 |
| - (with-current-buffer a |
84 |
| - (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
85 |
| - :to-equal ":keyword")))) |
| 81 | + (ict-with-assess-buffers |
| 82 | + ((a (insert "[^:keyword"))) |
| 83 | + (with-current-buffer a |
| 84 | + (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 85 | + :to-equal ":keyword")))) |
86 | 86 |
|
87 | 87 | (it "computes no bounds for point directly after a break expression"
|
88 |
| - (ict-with-assess-buffers |
89 |
| - ((a (insert "@"))) |
90 |
| - (with-current-buffer a |
91 |
| - (expect |
92 |
| - (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
93 |
| - :not :to-be nil)))) |
| 88 | + (ict-with-assess-buffers |
| 89 | + ((a (insert "@"))) |
| 90 | + (with-current-buffer a |
| 91 | + (expect |
| 92 | + (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 93 | + :not :to-be nil)))) |
94 | 94 |
|
95 | 95 | (it "computes bounds for [symbol"
|
96 |
| - (ict-with-assess-buffers |
97 |
| - ((a (insert "[symbol"))) |
98 |
| - (with-current-buffer a |
99 |
| - (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
100 |
| - :to-equal "symbol")))) |
| 96 | + (ict-with-assess-buffers |
| 97 | + ((a (insert "[symbol"))) |
| 98 | + (with-current-buffer a |
| 99 | + (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 100 | + :to-equal "symbol")))) |
101 | 101 |
|
102 | 102 | (it "computes bounds for (@deref (multiple break chars)"
|
103 |
| - (ict-with-assess-buffers |
104 |
| - ((a (insert "(@deref"))) |
105 |
| - (with-current-buffer a |
106 |
| - (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
107 |
| - :to-equal "deref"))))) |
| 103 | + (ict-with-assess-buffers |
| 104 | + ((a (insert "(@deref"))) |
| 105 | + (with-current-buffer a |
| 106 | + (expect (ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point)) |
| 107 | + :to-equal "deref"))))) |
108 | 108 |
|
109 | 109 | (describe "inf-clojure--sanitize-command"
|
110 | 110 | (it "sanitizes the command correctly"
|
111 |
| - (expect (inf-clojure--sanitize-command "(doc println)") :to-equal "(doc println)\n")) |
| 111 | + (expect (inf-clojure--sanitize-command "(doc println)") :to-equal "(doc println)\n")) |
112 | 112 |
|
113 | 113 | (it "trims newline at the right of a command"
|
114 |
| - (expect (inf-clojure--sanitize-command "(doc println)\n\n\n\n") :to-equal "(doc println)\n")) |
| 114 | + (expect (inf-clojure--sanitize-command "(doc println)\n\n\n\n") :to-equal "(doc println)\n")) |
115 | 115 |
|
116 | 116 | (it "returns empty string when the command is empty"
|
117 |
| - (expect (inf-clojure--sanitize-command " ") :to-equal "")) |
| 117 | + (expect (inf-clojure--sanitize-command " ") :to-equal "")) |
118 | 118 |
|
119 | 119 | (it "only removes whitespace at the end of the command - fix 152"
|
120 |
| - (expect (inf-clojure--sanitize-command "1 5") :to-equal "1 5\n"))) |
| 120 | + (expect (inf-clojure--sanitize-command "1 5") :to-equal "1 5\n"))) |
| 121 | + |
121 | 122 |
|
122 | 123 | (describe "inf-clojure--update-feature"
|
123 | 124 | (it "updates new forms correctly"
|
|
0 commit comments