File tree Expand file tree Collapse file tree
interpreter/cling/test/AutoComplete Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //------------------------------------------------------------------------------
2+ // CLING - the C++ LLVM-based InterpreterG :)
3+ //
4+ // This file is dual-licensed: you can choose to license it under the University
5+ // of Illinois Open Source License or the GNU Lesser General Public License. See
6+ // LICENSE.TXT for details.
7+ //------------------------------------------------------------------------------
8+
9+ // RUN: cat %s | %cling 2>&1 | FileCheck %s
10+
11+ // Test to check autocomplete functionality (adapted from CppInterOp)
12+
13+ #include "cling/Interpreter/Interpreter.h"
14+
15+ gCling -> process ("int foo = 12;" );
16+ std ::vector < std ::string > cc ;
17+ size_t cursor = 1 ;
18+ gCling -> codeComplete ("f" , cursor , cc );
19+
20+ // We check only for 'float' and 'foo', because they
21+ // must be present in the result. Other hints may appear
22+ // there, depending on the implementation, but these two
23+ // are required to say that the test is working.
24+ size_t cnt = 0 ;
25+ for (auto& r : cc ) {
26+ if (r == "float " || r == "[#int #]foo") cnt++;
27+ }
28+
29+ cnt
30+ // CHECK: (unsigned long) 2
31+ .q
You can’t perform that action at this time.
0 commit comments