Skip to content

Commit

Permalink
Added unit test for the error case of Vector>>#remove and #removeFirst
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Jan 26, 2024
1 parent f56cc8e commit ff9245b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions TestSuite/VectorSubclass.som
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VectorSubclass = Vector (
error: string = (
^ #error
)
)
12 changes: 12 additions & 0 deletions TestSuite/VectorTest.som
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ VectorTest = TestCase (
v remove ]
)

testRemoveOnEmptyWithSubclass = (
| v |
v := VectorSubclass new.
self assert: #error is: v remove.
)

testRemoveFirstOnEmptyWithSubclass = (
| v |
v := VectorSubclass new.
self assert: #error is: v removeFirst.
)

testContains = (
self assert: (a contains: 'hello').
self assert: (a contains: #world).
Expand Down

0 comments on commit ff9245b

Please sign in to comment.