diff options
Diffstat (limited to 'Omni/Task.hs')
| -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 |
