[lldb] Also Catch invalid calls to TestPExpectTest's expect()
authorRaphael Isemann <teemperor@gmail.com>
Thu, 5 Nov 2020 12:41:26 +0000 (13:41 +0100)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 5 Nov 2020 13:08:46 +0000 (14:08 +0100)
commit2f84b59a4cf92a0ce1b985e7f44e17483efa33c0
tree2feb428d8727238299161768ab933abff4eb7c01
parenta7bcb3b9eb762357d22bcbe4cdc9f5651c9b1f66
[lldb] Also Catch invalid calls to TestPExpectTest's expect()

This is a follow up to D88792 which found an issue in a call to PExpectTest's
expect function that allows passing a string to the `substrs` parameter. However
this issue was found by just grepping and TestPExpect's expect function is still
accepting a single string as a value to `substrs`.

This patch adds the same sanity check that D88792 added to the PExpectTest's
implementation of `expect` and also adds a small test for it.

Reviewed By: kastiglione, JDevlieghere

Differential Revision: https://reviews.llvm.org/D89302
lldb/packages/Python/lldbsuite/test/lldbpexpect.py
lldb/test/API/test_utils/TestPExpectTest.py [new file with mode: 0644]