Skip to content

Commit 3ab4461

Browse files
committed
DON'T MERGE: adding tests (#26)
Issues covered: - vala-language-server#106 - vala-language-server#153
1 parent 57d0a68 commit 3ab4461

7 files changed

+74
-202
lines changed

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ endif
6565
subdir('data')
6666
subdir('plugins/gnome-builder')
6767
subdir('src')
68-
subdir('test')
68+
subdir('tests')

subprojects/lstf.wrap

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[wrap-git]
2+
url = https://github.com/Prince781/lstf
3+
revision = head
4+
5+
# [provide]
6+
# program_names = lstf

test/meson.build

-8
This file was deleted.

test/testclient.vala

-193
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// issue: vala-language-server#106
2+
server_path = option('server-path');
3+
4+
let f = file('''
5+
void main() {
6+
print ("this is a string");
7+
}
8+
''')
9+
10+
project_files = [ f ];
11+
12+
await change(f, {
13+
range: {
14+
start: { line: 2, character: 29 },
15+
end: { line: 2, character: 29 }
16+
},
17+
text: '.'
18+
});
19+
20+
assert {
21+
isIncomplete: false,
22+
items: []
23+
} <=> await completion(f, 2, 29);
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// issue: vala-language-server#153
2+
server_path = '/usr/bin/vala-language-server';
3+
4+
let f = file('''
5+
void foo (int arg1, int arg2) {
6+
}
7+
void main() {
8+
foo
9+
}
10+
''')
11+
12+
project_files = [ f ];
13+
14+
15+
16+
await change(f, {
17+
range: {
18+
start: { line: 4, character: 7 },
19+
end: { line: 4, character: 7 }
20+
},
21+
text: ' ('
22+
});
23+
24+
assert {
25+
signatures: [
26+
label: 'void foo(int arg1, int arg2)',
27+
parameters: [ { label: 'int arg1' } ]
28+
],
29+
activeParameter: 0
30+
} <=> await signatureHelp(f, 4, 9);

tests/meson.build

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
lstf = find_program('lstf', required: false)
2+
3+
if not lstf.found()
4+
meson.override_find_program('lstf', subproject('lstf').get_variable('lstf'))
5+
lstf = find_program('lstf')
6+
endif
7+
8+
test('106-autocompletion-in-string-literals', lstf,
9+
workdir: meson.current_source_dir(),
10+
args: ['106-autocompletion-in-string-literals.lstf'])
11+
12+
test('153-signaturehelp-shared-prefix', lstf,
13+
workdir: meson.current_source_dir(),
14+
args: ['153-signaturehelp-shared-prefix.lstf'])

0 commit comments

Comments
 (0)