@@ -35,6 +35,51 @@ def test_basic_completion(self):
35
35
self .child .expect_exact ("Hasher" )
36
36
self .child .sendline ("" )
37
37
38
+ self .quit ()
39
+
40
+ # PExpect uses many timeouts internally and doesn't play well
41
+ # under ASAN on a loaded machine..
42
+ @skipIfAsan
43
+ @skipUnlessDarwin
44
+ def test_lldb_command_completion (self ):
45
+
46
+ self .launch (extra_args = ["--repl" ], executable = None , dimensions = (100 ,500 ))
47
+
48
+ # Wait on the first prompt
49
+ self .child .expect_exact ("1>" )
50
+
51
+ # Try completing something already complete.
52
+ self .child .send (":b\t " )
53
+ self .child .expect_exact (":b " )
54
+ self .child .sendline ("" )
55
+
56
+ # Try completing something that only has one result "vers" -> "version".
57
+ self .child .send (":vers\t " )
58
+ self .child .expect_exact (":version" )
59
+ self .child .sendline ("" )
60
+
61
+ # Try completing something that has multiple completions.
62
+ self .child .send (":\t " )
63
+ self .child .expect_exact ("Available completions:" )
64
+ self .child .expect_exact (":help" )
65
+ self .child .expect_exact ("More (Y/n/a)" )
66
+ self .child .send ("n" )
67
+ self .child .sendline ("help" )
68
+
69
+ # Try completing something with subcommands.
70
+ self .child .send (":breakpoi\t " )
71
+ self .child .expect_exact (":breakpoint " )
72
+ self .child .send ("\t " )
73
+ self .child .expect_exact ("Available completions:" )
74
+ self .child .expect_exact ("command" )
75
+ self .child .send ("comm\t " )
76
+ self .child .expect_exact (":breakpoint command " )
77
+ self .child .send ("li\t " )
78
+ self .child .expect_exact (":breakpoint command list" )
79
+ self .child .sendline ("" )
80
+
81
+ self .quit ()
82
+
38
83
def setUpCommands (self ):
39
84
return [] # REPL doesn't take any setup commands.
40
85
0 commit comments