verify that multiple decr's afterwords work

This commit is contained in:
Jaremy Creechley 2023-09-13 12:02:25 -07:00
parent bcce5331bb
commit 1991fdbc29
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -48,6 +48,10 @@ proc runDestroyOnReleaseTest() =
finally:
a.release()
check intref[] == 0
## important a should be nil now!
## to prevent future decr's from occuring
check a.isNil == true
a.decr()
suite "Share buffer test":
@ -86,6 +90,11 @@ suite "Share buffer test":
a.release()
check intref[] == 0
## important a should be nil now!
## to prevent future decr's from occuring
check a.isNil == true
a.decr()
test "test destroy release generic no proc":
echo "\nintref setup:\n"
let intref: ref int = new(ref int)
@ -96,4 +105,4 @@ suite "Share buffer test":
check b[].val[] == 30
finally:
b.release()
check intref[] == 0
check intref[] == 0