Test for unusual task data (#3770)

* Test for unusual task data

A task might have any combination of keys and values, but Taskwarrior
often assumes that only valid values can occur, and crashes otherwise.
This is highly inconvenient, as it's often impossible to do anything
with the invalid task -- Taskwarrior just fails without modifying it.

So, this is the beginning of some testing for such invalid tasks, with
the goal of making Taskwarrior due something reasonable. In general, an
invalid attribute value is treated as if it was not set. This is not
exhaustive, and there are likely still bugs of this sort, but as we find
them we can fix and add regression tests to this script.

This introduces a new test-only binary that creates a "bare" task using
TaskChampion, avoiding Taskwarrior's efforts to not create "unusual"
tasks.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Dustin J. Mitchell 2025-02-05 08:20:35 -05:00 committed by GitHub
parent e1fc283da5
commit fdb7e5e020
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 368 additions and 41 deletions

View file

@ -28,8 +28,11 @@ ON_POSIX = "posix" in sys.builtin_module_names
# Directory relative to basetest module location
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
# From the CMAKE value of the same name. This is substituted at configure.
CMAKE_BINARY_DIR = os.path.abspath("${CMAKE_BINARY_DIR}")
# Location of binary files (usually the src/ folder)
BIN_PREFIX = os.path.abspath(os.path.join("${CMAKE_BINARY_DIR}", "src"))
BIN_PREFIX = os.path.abspath(os.path.join(CMAKE_BINARY_DIR, "src"))
# Default location of test hooks
DEFAULT_HOOK_PATH = os.path.abspath(