@@ -84,7 +84,34 @@ module CircularBufferTests =
8484 Expect.throwsT< System.InvalidOperationException> " " f
8585 }
8686
87- ptest " Printing after multiple enqueue circles" {
87+ test " fail on negative offset" {
88+ let f =
89+ fun _ ->
90+ let circularBuffer = CircularBuffer< int> 5
91+ circularBuffer.Enqueue([| 1 ; 2 ; 3 |], - 1 , 2 )
92+
93+ Expect.throwsT< System.ArgumentException> " " f
94+ }
95+
96+ test " fail on negative count" {
97+ let f =
98+ fun _ ->
99+ let circularBuffer = CircularBuffer< int> 5
100+ circularBuffer.Enqueue([| 1 ; 2 ; 3 |], 0 , - 1 )
101+
102+ Expect.throwsT< System.ArgumentException> " " f
103+ }
104+
105+ test " fail when offset + count exceeds array length" {
106+ let f =
107+ fun _ ->
108+ let circularBuffer = CircularBuffer< int> 5
109+ circularBuffer.Enqueue([| 1 ; 2 ; 3 |], 2 , 3 )
110+
111+ Expect.throwsT< System.ArgumentException> " " f
112+ }
113+
114+ test " Printing after multiple enqueue circles" {
88115 let circularBuffer = CircularBuffer< int> 5
89116
90117 circularBuffer.Enqueue [| 1 ; 2 ; 3 ; 4 ; 5 |]
@@ -96,7 +123,7 @@ module CircularBufferTests =
96123
97124
98125
99- ptest " Printing from a queue 1..8 and dequeue 5, then enqueue 1..3 and dequeue 3, from array" {
126+ test " Printing from a queue 1..8 and dequeue 5, then enqueue 1..3 and dequeue 3, from array" {
100127 let circularBuffer = CircularBuffer< int> 5
101128
102129 circularBuffer.Enqueue([| 1 ; 2 ; 3 ; 4 ; 5 |])
@@ -106,7 +133,7 @@ module CircularBufferTests =
106133 Expect.equal " buffer" [| 1 ; 2 ; 3 |] <| circularBuffer.Dequeue 3
107134 }
108135
109- ptest " Consider a large array with various, incoming array segments" {
136+ test " Consider a large array with various, incoming array segments" {
110137 let circularBuffer = CircularBuffer< int> 5
111138
112139 let source =
0 commit comments