Skip to content

Commit

Permalink
Added a toString to UnwrappedEdgeCollection (#2033)
Browse files Browse the repository at this point in the history
Fixes #2030
  • Loading branch information
oxisto authored Feb 7, 2025
1 parent fe3a1f2 commit 541dea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ abstract class UnwrappedEdgeCollection<NodeType : Node, EdgeType : Edge<NodeType
return collection.resetTo(c)
}

override fun toString() = this.iterator().asSequence().toList().toString()

inner class Iterator(var edgeIterator: MutableIterator<Edge<NodeType>>) :
MutableIterator<NodeType> {
override fun remove() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class EdgesTest {

assertEquals(1, record.methods.size)
assertEquals(method, record.methods.firstOrNull())

assertEquals(
"RecordDeclaration[name=myRecord,location=<null>,name=myRecord,kind=class,superTypeDeclarations=[],fields=[],methods=[MethodDeclaration[name=myFunc,location=<null>,parameters=[]]],constructors=[],records=[]]",
record.toString(),
)
}
}
}

0 comments on commit 541dea1

Please sign in to comment.