File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -672,4 +672,26 @@ describe("Commit", function() {
672672 assert . equal ( startNonSelfFreeingCount , endNonSelfFreeingCount ) ;
673673 } ) ;
674674 } ) ;
675+
676+ it ( "duplicates signature" , function ( ) {
677+ garbageCollect ( ) ;
678+ var Signature = NodeGit . Signature ;
679+ var startSelfFreeingCount = Signature . getSelfFreeingInstanceCount ( ) ;
680+ var startNonSelfFreeingCount =
681+ Signature . getNonSelfFreeingConstructedCount ( ) ;
682+ var signature = this . commit . author ( ) ;
683+
684+ garbageCollect ( ) ;
685+ var endSelfFreeingCount = Signature . getSelfFreeingInstanceCount ( ) ;
686+ var endNonSelfFreeingCount = Signature . getNonSelfFreeingConstructedCount ( ) ;
687+ // we should get one duplicated, self-freeing signature
688+ assert . equal ( startSelfFreeingCount + 1 , endSelfFreeingCount ) ;
689+ assert . equal ( startNonSelfFreeingCount , endNonSelfFreeingCount ) ;
690+
691+ signature = null ;
692+ garbageCollect ( ) ;
693+ endSelfFreeingCount = Signature . getSelfFreeingInstanceCount ( ) ;
694+ // the self-freeing signature should get freed
695+ assert . equal ( startSelfFreeingCount , endSelfFreeingCount ) ;
696+ } ) ;
675697} ) ;
You can’t perform that action at this time.
0 commit comments