Skip to content

Commit

Permalink
DON'T MERGE: adding tests (#26)
Browse files Browse the repository at this point in the history
Issues covered:
- vala-language-server#106
- vala-language-server#153
  • Loading branch information
Prince781 committed Apr 17, 2021
1 parent 57d0a68 commit 3ab4461
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 202 deletions.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ endif
subdir('data')
subdir('plugins/gnome-builder')
subdir('src')
subdir('test')
subdir('tests')
6 changes: 6 additions & 0 deletions subprojects/lstf.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-git]
url = https://github.com/Prince781/lstf
revision = head

# [provide]
# program_names = lstf
8 changes: 0 additions & 8 deletions test/meson.build

This file was deleted.

193 changes: 0 additions & 193 deletions test/testclient.vala

This file was deleted.

23 changes: 23 additions & 0 deletions tests/106-autocompletion-in-string-literals.lstf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// issue: vala-language-server#106
server_path = option('server-path');

let f = file('''
void main() {
print ("this is a string");
}
''')

project_files = [ f ];

await change(f, {
range: {
start: { line: 2, character: 29 },
end: { line: 2, character: 29 }
},
text: '.'
});

assert {
isIncomplete: false,
items: []
} <=> await completion(f, 2, 29);
30 changes: 30 additions & 0 deletions tests/153-signaturehelp-shared-prefix.lstf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// issue: vala-language-server#153
server_path = '/usr/bin/vala-language-server';

let f = file('''
void foo (int arg1, int arg2) {
}
void main() {
foo
}
''')

project_files = [ f ];



await change(f, {
range: {
start: { line: 4, character: 7 },
end: { line: 4, character: 7 }
},
text: ' ('
});

assert {
signatures: [
label: 'void foo(int arg1, int arg2)',
parameters: [ { label: 'int arg1' } ]
],
activeParameter: 0
} <=> await signatureHelp(f, 4, 9);
14 changes: 14 additions & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
lstf = find_program('lstf', required: false)

if not lstf.found()
meson.override_find_program('lstf', subproject('lstf').get_variable('lstf'))
lstf = find_program('lstf')
endif

test('106-autocompletion-in-string-literals', lstf,
workdir: meson.current_source_dir(),
args: ['106-autocompletion-in-string-literals.lstf'])

test('153-signaturehelp-shared-prefix', lstf,
workdir: meson.current_source_dir(),
args: ['153-signaturehelp-shared-prefix.lstf'])

0 comments on commit 3ab4461

Please sign in to comment.