Skip to content

Commit b3ba4b7

Browse files
Peter Wilhelmsson2hdddg
authored andcommitted
tests: Verifies that summary is reset
1 parent 8eeb47b commit b3ba4b7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

neo4j/test-integration/session_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,26 @@ var _ = Describe("Session", func() {
257257
Expect(summary.ResultConsumedAfter()).To(BeNumerically(">=", 0))
258258
})
259259

260+
Specify("on multiple runs summary counters should be correct", func() {
261+
result, _ = session.Run("CREATE (p:Person { name: 'one'})", nil)
262+
summary, _ = result.Consume()
263+
counters := summary.Counters()
264+
265+
Expect(counters.NodesCreated()).To(BeIdenticalTo(1))
266+
Expect(counters.NodesDeleted()).To(BeZero())
267+
Expect(counters.RelationshipsCreated()).To(BeZero())
268+
Expect(counters.RelationshipsDeleted()).To(BeZero())
269+
270+
result, _ = session.Run("MATCH (p:Person { name: 'one'}) RETURN p", nil)
271+
summary, _ = result.Consume()
272+
counters = summary.Counters()
273+
274+
Expect(counters.NodesCreated()).To(BeZero())
275+
Expect(counters.NodesDeleted()).To(BeZero())
276+
Expect(counters.RelationshipsCreated()).To(BeZero())
277+
Expect(counters.RelationshipsDeleted()).To(BeZero())
278+
})
279+
260280
Specify("when one statement fails, the next one should run successfully", func() {
261281
result, err = session.Run("Invalid Cypher", nil)
262282
Expect(result).To(BeNil())

0 commit comments

Comments
 (0)