File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,11 @@ mutable struct DiBitVector <: AbstractVector{UInt8}
13
13
len:: UInt
14
14
15
15
function DiBitVector (n:: Integer , v:: Integer )
16
+ if Int (n) < 0
17
+ throw (ArgumentError (" n ($n ) must be greater than or equal to zero" ))
18
+ end
16
19
if ! (Int (v) in 0 : 3 )
17
- throw (ArgumentError (" v must be in 0:3" ))
20
+ throw (ArgumentError (" v ( $v ) must be in 0:3" ))
18
21
end
19
22
fv = (0x0000000000000000 , 0x5555555555555555 ,
20
23
0xaaaaaaaaaaaaaaaa , 0xffffffffffffffff )[v + 1 ]
Original file line number Diff line number Diff line change 6
6
@test_throws ArgumentError DiBitVector (5 , 4 )
7
7
@test_throws ArgumentError DiBitVector (5 , - 1 )
8
8
9
+ @test_throws ArgumentError DiBitVector (- 5 )
10
+ @test_throws ArgumentError DiBitVector (- 5 , 1 )
11
+
9
12
@test length (d0) == 0
10
13
@test isempty (d0)
11
14
@test_throws ArgumentError pop! (d0)
You can’t perform that action at this time.
0 commit comments