diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 15:09:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 15:09:08 +0000 |
commit | b3a736ed88a1db0391cd9881e70b987bab7d89d1 (patch) | |
tree | a91ca3a06abd4c3412775ac3c49b11e3151df2be /spec/services/projects | |
parent | 5366964a10484c2783a646b35a6da9eece01b242 (diff) | |
download | gitlab-ce-b3a736ed88a1db0391cd9881e70b987bab7d89d1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/lsif_data_service_spec.rb | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/spec/services/projects/lsif_data_service_spec.rb b/spec/services/projects/lsif_data_service_spec.rb index 29a99a96c41..93579869d1d 100644 --- a/spec/services/projects/lsif_data_service_spec.rb +++ b/spec/services/projects/lsif_data_service_spec.rb @@ -12,6 +12,10 @@ describe Projects::LsifDataService do let(:service) { described_class.new(artifact.file, project, params) } describe '#execute' do + def highlighted_value(value) + [{ language: 'go', value: Gitlab::Highlight.highlight(nil, value, language: 'go') }] + end + context 'fetched lsif file', :use_clean_rails_memory_store_caching do it 'is cached' do service.execute @@ -32,42 +36,48 @@ describe Projects::LsifDataService do end_line: 6, start_char: 5, start_line: 6, - definition_url: "#{path_prefix}/main.go#L7" + definition_url: "#{path_prefix}/main.go#L7", + hover: highlighted_value('func main()') }, { end_char: 36, end_line: 3, start_char: 1, start_line: 3, - definition_url: "#{path_prefix}/main.go#L4" + definition_url: "#{path_prefix}/main.go#L4", + hover: highlighted_value('package "github.com/user/hello/morestrings" ("github.com/user/hello/morestrings")') }, { end_char: 12, end_line: 7, start_char: 1, start_line: 7, - definition_url: "#{path_prefix}/main.go#L4" + definition_url: "#{path_prefix}/main.go#L4", + hover: highlighted_value('package "github.com/user/hello/morestrings" ("github.com/user/hello/morestrings")') }, { end_char: 20, end_line: 7, start_char: 13, start_line: 7, - definition_url: "#{path_prefix}/morestrings/reverse.go#L11" + definition_url: "#{path_prefix}/morestrings/reverse.go#L11", + hover: highlighted_value('func Reverse(s string) string') + [{ value: "This method reverses a string \n\n" }] }, { end_char: 12, end_line: 8, start_char: 1, start_line: 8, - definition_url: "#{path_prefix}/main.go#L4" + definition_url: "#{path_prefix}/main.go#L4", + hover: highlighted_value('package "github.com/user/hello/morestrings" ("github.com/user/hello/morestrings")') }, { end_char: 18, end_line: 8, start_char: 13, start_line: 8, - definition_url: "#{path_prefix}/morestrings/reverse.go#L5" + definition_url: "#{path_prefix}/morestrings/reverse.go#L5", + hover: highlighted_value('func Func2(i int) string') } ]) end @@ -82,7 +92,8 @@ describe Projects::LsifDataService do end_line: 11, start_char: 1, start_line: 11, - definition_url: "/#{project.full_path}/-/blob/#{commit_id}/morestrings/reverse.go#L12" + definition_url: "/#{project.full_path}/-/blob/#{commit_id}/morestrings/reverse.go#L12", + hover: highlighted_value('var a string') }) end end |