Skip to content

sorted set tests broken when run individually #153

Open

Description

nim c -r test_sorted_set "Delete items"

[Suite] SortedSet: Sorted list based on red-black tree
    /home/arnetheduck/status/nimbus-eth2/vendor/nim-stew/tests/test_sorted_set.nim(133, 22): Check failed: data.isOk == canDeleteOk
    data.isOk was false
    canDeleteOk was true
/home/arnetheduck/status/nimbus-eth2/vendor/nim-unittest2/unittest2.nim(848) unittest2
/home/arnetheduck/status/nimbus-eth2/vendor/nim-stew/tests/test_sorted_set.nim(136) runTestX60gensym287
/home/arnetheduck/status/nimbus-eth2/vendor/nim-stew/stew/results.nim(378) get
/home/arnetheduck/status/nimbus-eth2/vendor/nim-stew/stew/results.nim(368) raiseResultDefect

    Unhandled exception: Trying to access value with err Result: rbEmptyTree [ResultDefect]

this is because a global variable is used here:

https://github.com/status-im/nim-stew/blob/master/tests/test_sorted_set.nim#L76

suite variables should use setup: to ensure that a fresh variable is used for every test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions