diff options
| author | ruki <[email protected]> | 2025-03-22 00:43:40 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-08 15:31:55 +0800 |
| commit | 4a8219cda19cf320330ab7488f53158624c8c393 (patch) | |
| tree | 7348edfb0b0ea27e3b22dfff89df00f8f8a6798d /tests/modules/graph/test.lua | |
| parent | 63ed1854ea964fbbe7bc9dbdd8e2c34068dff7de (diff) | |
update comments
Diffstat (limited to 'tests/modules/graph/test.lua')
| -rw-r--r-- | tests/modules/graph/test.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/modules/graph/test.lua b/tests/modules/graph/test.lua index 1fb0bcb43..c242962db 100644 --- a/tests/modules/graph/test.lua +++ b/tests/modules/graph/test.lua @@ -46,12 +46,14 @@ function test_paritail_topo_sort(t) local order_vertices = {} while true do node, has_cycle = dag:partial_topo_sort_next() - if node == nil or has_cycle then - break - end - table.insert(order_vertices, node) if node then + table.insert(order_vertices, node) dag:partial_topo_sort_remove(node) + else + if has_cycle then + raise("has cycle!") + end + break end end |
