mirror of https://github.com/pwndbg/pwndbg.git
Test that gdb and argparse give the same help message (#2961)
* test that gdb and argparse give the same help message * fix misc test * rstrip outputs * added comment explaining the down aliases * Update pwndbg/commands/ida.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/gdb-tests/tests/test_misc.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>pull/2967/head
parent
eac203cf10
commit
c8793b87d3
@ -0,0 +1,20 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import gdb
|
||||
|
||||
import pwndbg
|
||||
|
||||
|
||||
def test_consistent_help():
|
||||
"""
|
||||
Tests that the help printed by gdb (via `help cmd`) is
|
||||
the exact same as the help printed by argparse (via `cmd -h`).
|
||||
"""
|
||||
|
||||
for cmd in pwndbg.commands.commands:
|
||||
name = cmd.command_name
|
||||
gdb_out = gdb.execute(f"help {name}", to_string=True)
|
||||
argparse_out = gdb.execute(f"{name} -h", to_string=True)
|
||||
|
||||
# I would rather not strip, but gdb is inconsistent between versions.
|
||||
assert gdb_out.rstrip() == argparse_out.rstrip()
|
||||
Loading…
Reference in new issue