File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ julia> sizeof("∀")
157
157
sizeof (s:: AbstractString ) = ncodeunits (s) * sizeof (codeunit (s))
158
158
firstindex (s:: AbstractString ) = 1
159
159
lastindex (s:: AbstractString ) = thisind (s, ncodeunits (s))
160
+ isempty (s:: AbstractString ) = iszero (ncodeunits (s))
160
161
161
162
function getindex (s:: AbstractString , i:: Integer )
162
163
@boundscheck checkbounds (s, i)
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ using Random
20
20
@test s == " ab"
21
21
22
22
@test isempty (string ())
23
+ @test ! isempty (" abc" )
24
+ @test ! isempty (" ∀∃" )
25
+ @test ! isempty (GenericString (" ∀∃" ))
26
+ @test isempty (GenericString (" " ))
27
+ @test ! isempty (GenericString (" abc" ))
23
28
@test eltype (GenericString) == Char
24
29
@test firstindex (" abc" ) == 1
25
30
@test cmp (" ab" ," abc" ) == - 1
You can’t perform that action at this time.
0 commit comments