[clang-tools-extra] r304983 - [clangd] extend completion test

Krasimir Georgiev via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 8 09:02:27 PDT 2017


Author: krasimir
Date: Thu Jun  8 11:02:27 2017
New Revision: 304983

URL: http://llvm.org/viewvc/llvm-project?rev=304983&view=rev
Log:
[clangd] extend completion test

Modified:
    clang-tools-extra/trunk/test/clangd/completion.test

Modified: clang-tools-extra/trunk/test/clangd/completion.test
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clangd/completion.test?rev=304983&r1=304982&r2=304983&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clangd/completion.test (original)
+++ clang-tools-extra/trunk/test/clangd/completion.test Thu Jun  8 11:02:27 2017
@@ -23,6 +23,32 @@ Content-Length: 148
 # CHECK-DAG: {"label":"~fake()","kind":4,"detail":"void","sortText":"~fake","filterText":"~fake","insertText":"~fake"}
 # CHECK-DAG: {"label":"f(int i, const float f) const","kind":2,"detail":"int","sortText":"f","filterText":"f","insertText":"f"}
 # CHECK: ]}
-Content-Length: 146
+Content-Length: 148
 
-{"jsonrpc":"2.0","id":2,"method":"shutdown"}
+{"jsonrpc":"2.0","id":2,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":3,"character":5}}}
+# Repeat the completion request, expect the same results.
+#
+# CHECK: {"jsonrpc":"2.0","id":2,"result":[
+# CHECK-DAG: {"label":"a","kind":5,"detail":"int","sortText":"a","filterText":"a","insertText":"a"}
+# CHECK-DAG: {"label":"bb","kind":5,"detail":"int","sortText":"bb","filterText":"bb","insertText":"bb"}
+# CHECK-DAG: {"label":"ccc","kind":5,"detail":"int","sortText":"ccc","filterText":"ccc","insertText":"ccc"}
+# CHECK-DAG: {"label":"operator=(const fake &)","kind":2,"detail":"fake &","sortText":"operator=","filterText":"operator=","insertText":"operator="}
+# CHECK-DAG: {"label":"~fake()","kind":4,"detail":"void","sortText":"~fake","filterText":"~fake","insertText":"~fake"}
+# CHECK-DAG: {"label":"f(int i, const float f) const","kind":2,"detail":"int","sortText":"f","filterText":"f","insertText":"f"}
+# CHECK: ]}
+# Update the source file and check for completions again.
+Content-Length: 226
+
+{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///main.cpp","version":2},"contentChanges":[{"text":"struct fancy { int (*func())(int, int); };\nint main() {\n  fancy f;\n  f.\n}\n"}]}}
+
+Content-Length: 148
+
+{"jsonrpc":"2.0","id":3,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":3,"character":5}}}
+# Repeat the completion request, expect the same results.
+#
+# CHECK: {"jsonrpc":"2.0","id":3,"result":[
+# CHECK-DAG: {"label":"func()","kind":2,"detail":"int (*)(int, int)","sortText":"func","filterText":"func","insertText":"func"}
+# CHECK: ]}
+Content-Length: 44
+
+{"jsonrpc":"2.0","id":4,"method":"shutdown"}




More information about the cfe-commits mailing list