diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-20 19:15:41 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-20 19:15:41 -0500 |
| commit | 946ebcfbb2b19e7469c9519c231736563a6b6fb6 (patch) | |
| tree | 502dcb943ff8176c2c1d1ff4e01f417030eb5647 | |
| parent | 9a256f5c8232713ee99cb78093434a32c304e192 (diff) | |
feat: implement t-PpYZt2
| -rw-r--r-- | Omni/Task.hs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs index 6624b31..24e528b 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -330,7 +330,29 @@ unitTests = grandchild1 <- createTask "Grandchild 1" WorkTask (Just (taskId child)) Nothing P2 [] grandchild2 <- createTask "Grandchild 2" WorkTask (Just (taskId child)) Nothing P2 [] taskId grandchild1 Test.@?= taskId parent <> ".1.1" - taskId grandchild2 Test.@?= taskId parent <> ".1.2" + taskId grandchild2 Test.@?= taskId parent <> ".1.2", + Test.unit "child ID generation skips gaps" <| do + parent <- createTask "Parent with gaps" Epic Nothing Nothing P2 [] + child1 <- createTask "Child 1" WorkTask (Just (taskId parent)) Nothing P2 [] + -- Manually create a task with .3 suffix to simulate a gap (or deleted task) + let child3Id = taskId parent <> ".3" + child3 = Task + { taskId = child3Id, + taskTitle = "Child 3", + taskType = WorkTask, + taskParent = Just (taskId parent), + taskNamespace = Nothing, + taskStatus = Open, + taskPriority = P2, + taskDependencies = [], + taskCreatedAt = taskCreatedAt child1, + taskUpdatedAt = taskUpdatedAt child1 + } + saveTask child3 + + -- Create a new child, it should get .4, not .2 + child4 <- createTask "Child 4" WorkTask (Just (taskId parent)) Nothing P2 [] + taskId child4 Test.@?= taskId parent <> ".4" ] -- | Test CLI argument parsing to ensure docopt string matches actual usage |
