Skip to content

Commit 6c7efe2

Browse files
committed
[lldb][NFC] Fix expect calls with wrong order of 'substrs' items for D73766
Currently the substrs parameter takes a list of strings that need to be found but the ordering isn't checked. D73766 might change that so this changes a several tests so that the order of the strings in the substrs list is in the order in which they appear in the output.
1 parent f99133e commit 6c7efe2

File tree

17 files changed

+51
-51
lines changed

17 files changed

+51
-51
lines changed

lldb/packages/Python/lldbsuite/test/commands/command/script/TestCommandScript.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ def cleanup():
8686
substrs=["Python command defined by @lldb.command"])
8787

8888
self.expect("help",
89-
substrs=['For more information run',
90-
'welcome'] + decorated_commands)
89+
substrs=['For more information run']
90+
+ decorated_commands + ['welcome'])
9191

9292
self.expect("help -a",
93-
substrs=['For more information run',
94-
'welcome'] + decorated_commands)
93+
substrs=['For more information run']
94+
+ decorated_commands + ['welcome'])
9595

9696
self.expect("help -u", matching=False,
9797
substrs=['For more information run'])

lldb/packages/Python/lldbsuite/test/commands/help/TestHelp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def version_number_string(self):
7878
def test_help_arch(self):
7979
"""Test 'help arch' which should list of supported architectures."""
8080
self.expect("help arch",
81-
substrs=['arm', 'x86_64', 'i386'])
81+
substrs=['arm', 'i386', 'x86_64'])
8282

8383
@no_debug_info_test
8484
def test_help_version(self):

lldb/packages/Python/lldbsuite/test/commands/platform/process/TestProcessList.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ def test_process_list_with_args(self):
2929
self.addTearDownHook(self.cleanupSubprocesses)
3030

3131
self.expect("platform process list -v",
32-
substrs=["TestProcess arg1 --arg2 arg3", str(popen.pid)])
32+
substrs=[str(popen.pid), "TestProcess arg1 --arg2 arg3"])

lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def test_watchpoint_command(self):
8787

8888
# Check that the watchpoint snapshoting mechanism is working.
8989
self.expect("watchpoint list -v",
90-
substrs=['old value:', ' = 0',
91-
'new value:', ' = 1'])
90+
substrs=['old value: 0',
91+
'new value: 1'])
9292

9393
# The watchpoint command "forced" our global variable 'cookie' to
9494
# become 777.

lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_commands/condition/TestWatchpointConditionCmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_watchpoint_cond(self):
7070
# Use the '-v' option to do verbose listing of the watchpoint.
7171
# The hit count should be 0 initially.
7272
self.expect("watchpoint list -v",
73-
substrs=['hit_count = 0', 'global==5'])
73+
substrs=['global==5', 'hit_count = 0'])
7474

7575
self.runCmd("process continue")
7676

lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ def inlined_breakpoints(self):
6262
# And it should break at basic_type.cpp:176.
6363
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
6464
substrs=['stopped',
65-
'stop reason = breakpoint',
66-
'basic_type.cpp:%d' % self.line])
65+
'basic_type.cpp:%d' % self.line,
66+
'stop reason = breakpoint',])

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def rdar11106605_commands(self):
7777

7878
def nsstring_data_formatter_commands(self):
7979
self.expect('frame variable str0 str1 str2 str3 str4 str5 str6 str8 str9 str10 str11 label1 label2 processName str12',
80-
substrs=['(NSString *) str1 = ', ' @"A rather short ASCII NSString object is here"',
80+
substrs=[
8181
# '(NSString *) str0 = ',' @"255"',
8282
'(NSString *) str1 = ', ' @"A rather short ASCII NSString object is here"',
8383
'(NSString *) str2 = ', ' @"A rather short UTF8 NSString object is here"',

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,17 @@ def cleanup():
102102
self.expect(
103103
"frame variable ss",
104104
substrs=["size=4",
105-
'[2] = "b"',
106-
'[3] = "c"',
107105
'[0] = "a"',
108-
'[1] = "a very long string is right here"'])
106+
'[1] = "a very long string is right here"',
107+
'[2] = "b"',
108+
'[3] = "c"'])
109109
self.expect(
110110
"p ss",
111111
substrs=["size=4",
112-
'[2] = "b"',
113-
'[3] = "c"',
114112
'[0] = "a"',
115-
'[1] = "a very long string is right here"'])
113+
'[1] = "a very long string is right here"',
114+
'[2] = "b"',
115+
'[3] = "c"'])
116116
self.expect("frame variable ss[2]", substrs=[' = "b"'])
117117
lldbutil.continue_to_breakpoint(process, bkpt)
118118
self.expect(

lldb/packages/Python/lldbsuite/test/functionalities/multiword-commands/TestMultiWordCommands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def test_ambiguous_subcommand(self):
1515
self.expect("platform s", error=True,
1616
substrs=["ambiguous command 'platform s'. Possible completions:",
1717
"\tselect\n",
18-
"\tshell\n",
19-
"\tsettings\n"])
18+
"\tsettings\n",
19+
"\tshell\n"])
2020

2121
@no_debug_info_test
2222
def test_empty_subcommand(self):

lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def test_break(self):
4141

4242
self.runCmd("run", RUN_SUCCEEDED)
4343
self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
44-
substrs=[" at %s:%d" % (self.main_source, self.line),
45-
"stop reason = breakpoint"])
44+
substrs=["stop reason = breakpoint",
45+
" at %s:%d" % (self.main_source, self.line)])
4646

4747
self.expect('expression (int)[str compare:@"hello"]',
4848
startstr="(int) $0 = 0")

0 commit comments

Comments
 (0)