Skip to content

Commit

Permalink
Fix VectorTest>>#testFirst
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Feb 29, 2024
1 parent a376c6c commit 99b7c32
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions Examples/Benchmarks/TestSuite/TestCommon.som
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TestCommon = Benchmark (
numExecs = (
self error: 'Implement in subclass and return the number of times a test is executed'
)

oneTimeSetup = (
"Load all Tests. We don't really want to benchmark the parser."
self tests
Expand Down Expand Up @@ -77,17 +77,17 @@ TestCommon = Benchmark (
runner run.
runner hasFailures ifTrue: [system exit: 1]
)

benchmark = (
failOnUnsupportedOptionals := false.
^ self runAllSuites
)

verifyResult: result = (
"result do: [:e | e println ]."
^ (result at: 1) = (190 * self numExecs) and: [
(result at: 2) = (0 * self numExecs) and: [
(result at: 3) = (189 * self numExecs) and: [
(result at: 3) = (190 * self numExecs) and: [
(result at: 4) = (992 * self numExecs)
] ] ]
)
Expand Down
40 changes: 20 additions & 20 deletions Examples/Benchmarks/TestSuite/VectorTest.som
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ VectorTest = TestCase (
self assert: 1 equals: v first ].

1 to: 10 do: [:i |
self assert: 1 equals: v first.
self assert: i equals: v first.
v removeFirst ]
)

Expand Down Expand Up @@ -148,7 +148,7 @@ VectorTest = TestCase (
self assert: 1 equals: (arr at: 1).
self assert: 2 equals: (arr at: 2).
)

testAsSet = (
| v set |
v := Vector new.
Expand All @@ -157,38 +157,38 @@ VectorTest = TestCase (
v append: 3.
v append: 4.
self assert: 4 equals: v size.

set := v asSet.
self assert: 4 equals: set size.

v append: 1.
v append: 1.
v append: 1.

self assert: 4 + 3 equals: v size.

set := v asSet.
self assert: 4 equals: set size.
)

testIsEmpty = (
| v |
v := Vector new.
self assert: v isEmpty.

v append: 1.
self deny: v isEmpty.

v removeFirst.
self assert: v isEmpty.

v append: #ee.
self deny: v isEmpty.

v removeFirst.
self assert: v isEmpty.
self assert: v isEmpty.
)

testRemoveObj = (
| v |
v := Vector new.
Expand All @@ -200,31 +200,31 @@ VectorTest = TestCase (
v append: #f.
v append: #g.
v append: #h.

self assert: 8 equals: v size.

self deny: (v remove: #aa).
self assert: (v remove: #e).
self assert: 7 equals: v size.
)

testAppendComma = (
| v |
v := Vector new.
v, #a.
v, #b.

self assert: 2 equals: v size.
self assert: (v contains: #a).
self assert: (v contains: #b).
)

testDoIndexes = (
| i v |
v := Vector new.
v doIndexes: [:j |
self assert: false ].

v appendAll: #(1 2 3 4 5).
i := 1.
v doIndexes: [:j |
Expand All @@ -233,7 +233,7 @@ VectorTest = TestCase (
].
self assert: 6 equals: i.
)

testDo = (
| i v |
v := Vector new.
Expand Down

0 comments on commit 99b7c32

Please sign in to comment.