Skip to content

Commit 293f2ec

Browse files
committed
Test empty string and AbstractString cases
1 parent 20a0e5e commit 293f2ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,17 @@ umc = UE.matchchar
7272

7373
@testset "lookupname" begin
7474
@test UE.lookupname("foobar") == ""
75+
@test EE.lookupname(SubString("My name is Spock", 12)) == ""
7576
@test UE.lookupname("end of text") == "\x03" # \3
7677
@test UE.lookupname("TIBETAN LETTER -A") == "\u0f60"
7778
@test UE.lookupname("LESS-THAN OR SLANTED EQUAL TO") == "\u2a7d"
7879
@test UE.lookupname("REVERSED HAND WITH MIDDLE FINGER EXTENDED") == "\U1f595"
7980
end
8081

8182
@testset "matches" begin
83+
@test isempty(UE.matches(""))
8284
@test isempty(UE.matches("\uf900"))
85+
@test isempty(UE.matches(SubString("This is \uf900", 9)))
8386
for (chrs, exp) in (("\U1f596", ["RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS"]),
8487
("\u0f4a", ["TIBETAN LETTER REVERSED TA"]),
8588
(".", ["FULL STOP", "PERIOD"]))
@@ -91,6 +94,7 @@ end
9194

9295
@testset "longestmatches" begin
9396
@test isempty(UE.longestmatches("\uf900 abcd"))
97+
@test isempty(UE.longestmatches(SubString("This is \uf900 abcd", 9)))
9498
for (chrs, exp) in (("\U1f596 abcd", ["RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS"]),
9599
(".abcd", ["FULL STOP", "PERIOD"]),
96100
("\u0f4a#123", ["TIBETAN LETTER REVERSED TA", "TIBETAN LETTER TTA"]))
@@ -102,6 +106,7 @@ end
102106

103107
@testset "completions" begin
104108
@test isempty(UE.completions("ScottPaulJones"))
109+
@test isempty(EE.completions(SubString("My name is Scott", 12)))
105110
for (chrs, exp) in (("ZERO", ["ZERO WIDTH JOINER", "ZERO WIDTH NO-BREAK SPACE",
106111
"ZERO WIDTH NON-JOINER", "ZERO WIDTH SPACE"]),
107112
("BACK OF", ["BACK OF ENVELOPE"]))

0 commit comments

Comments
 (0)