Skip to content

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Oct 16, 2024

  • When a node refers to itself in a pair it means the node exists but does not depend on anything
  • Previously, this input would result in a "cycle" error
  • In my test file, allow node 'd' to be added to hash %npred with predecessor count of zero, so it then appears in list @list
  • The inner "foreach" loop does not execute for node 'd' because it has no dependency; it has no need for an entry in hash %succ
%perl cat in.tsort2
a b
b
  c
d d
%perl tsort.old in.tsort2
a
b
c
tsort.old: cycle detected
%perl tsort in.tsort2 # patched
a
b
c
d
%perl cat in.tsort3
a a
%perl tsort in.tsort3 # output agrees with GNU tsort
a

* When a node refers to itself in a pair it means the node exists but does not depend on anything
* Previously, this input would result in a "cycle" error
* In test file, allow node 'd' to be added to npred-hash with a predecessor count of zero, so it can appear in list-list
* The inner "foreach" loop does not execute for node 'd' because it has no dependency; it has no need for an entry in succ-hash

%perl cat in.tsort2
a b
b
  c
d d
%perl tsort.old in.tsort2
a
b
c
tsort.old: cycle detected
%perl tsort in.tsort2
a
b
c
d
%perl cat in.tsort3
a a
%perl tsort in.tsort3
a
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: tsort The sort program labels Oct 16, 2024
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:45 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 16, 2024 00:46 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Oct 16, 2024

Pull Request Test Coverage Report for Build 11356756634

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.805%

Totals Coverage Status
Change from base Build 11349099383: 0.0%
Covered Lines: 355
Relevant Lines: 481

💛 - Coveralls

@briandfoy briandfoy merged commit 11555c6 into briandfoy:master Oct 16, 2024
23 checks passed
@briandfoy
Copy link
Owner

changes: allow nodes to refer to themselves (has no dependency). This previously created a cycle error.

@briandfoy briandfoy added the Status: accepted The fix is accepted label Dec 9, 2024
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Priority: low get to this whenever Status: accepted The fix is accepted labels Dec 9, 2024
@briandfoy briandfoy self-assigned this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: tsort The sort program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants