/ test / completion / test_completion_prefixes.vader
test_completion_prefixes.vader
 1  Given typescript():
 2    let abc = y.
 3    let foo = ab
 4    let foo = (ab)
 5    let string1 = '
 6    let string2 = "
 7  
 8  Execute(Completion should be done after dots in TypeScript):
 9    AssertEqual '.', ale#completion#GetPrefix(&filetype, 1, 13)
10  
11  Execute(Completion should be done after words in TypeScript):
12    AssertEqual 'ab', ale#completion#GetPrefix(&filetype, 2, 13)
13  
14  Execute(Completion should be done after words in parens in TypeScript):
15    AssertEqual 'ab', ale#completion#GetPrefix(&filetype, 3, 14)
16  
17  Execute(Completion should not be done after parens in TypeScript):
18    AssertEqual '', ale#completion#GetPrefix(&filetype, 3, 15)
19  
20  Execute(Completion should be done after strings in TypeScript):
21    AssertEqual '''', ale#completion#GetPrefix(&filetype, 4, 16)
22    AssertEqual '"', ale#completion#GetPrefix(&filetype, 5, 16)
23  
24  Execute(Completion prefixes should work for other filetypes):
25    AssertEqual 'ab', ale#completion#GetPrefix('xxxyyyzzz', 3, 14)
26  
27  Execute(Completion prefixes should work for other filetypes):
28    AssertEqual 'ab', ale#completion#GetPrefix('xxxyyyzzz', 3, 14)
29  
30  Given rust():
31    let abc = y.
32    let abc = String::
33    let foo = (ab)
34  
35  Execute(Completion should be done after dots in Rust):
36    AssertEqual '.', ale#completion#GetPrefix(&filetype, 1, 13)
37  
38  Execute(Completion should be done after colons in Rust):
39    AssertEqual '::', ale#completion#GetPrefix(&filetype, 2, 19)
40  
41  Execute(Completion should be done after words in parens in Rust):
42    AssertEqual 'ab', ale#completion#GetPrefix(&filetype, 3, 14)
43  
44  Execute(Completion should not be done after parens in Rust):
45    AssertEqual '', ale#completion#GetPrefix(&filetype, 3, 15)
46  
47  Given lisp():
48    (minus-name
49    (full-name)
50  
51  Execute(Completion should be done for function names with minuses in Lisp):
52    AssertEqual 'minus-name', ale#completion#GetPrefix(&filetype, 1, 12)
53  
54  Execute(Completion should not be done after parens in Lisp):
55    AssertEqual '', ale#completion#GetPrefix(&filetype, 2, 12)
56  
57  Given clojure():
58    (minus-name
59    (full-name)
60  
61  Execute(Completion should be done for function names with minuses in Clojure):
62    AssertEqual 'minus-name', ale#completion#GetPrefix(&filetype, 1, 12)
63  
64  Execute(Completion should not be done after parens in Clojure):
65    AssertEqual '', ale#completion#GetPrefix(&filetype, 2, 12)