From f3da4269a609537022eaa4e1cea734c6644be9fd Mon Sep 17 00:00:00 2001 From: mecaneer23 Date: Fri, 26 Jan 2024 12:55:37 -0600 Subject: [PATCH] refactor: add tester to md_to_py.py --- src/md_to_py.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/md_to_py.py b/src/md_to_py.py index 2659fe9..1380d25 100644 --- a/src/md_to_py.py +++ b/src/md_to_py.py @@ -130,5 +130,16 @@ def md_table_to_lines( return lines - # Join the lines together into a list of formatted strings - return _to_lines_join(split_lines, columns) +if __name__ == "__main__": + print(_get_column_widths("| Flag | Description |")) + for line in md_table_to_lines(130, 137, "md_to_py.py", ("*",)): + pass + _ = """ +| Flag | Description | +| --------------- | ------------------------------- | +| **-h** | Display help message | +| **-v** | Enable verbose output | +| **-f** FILENAME | Specify input file | +| **-o** FILENAME | Specify output file | +| **-n** | Do not overwrite existing files | +"""