@@ -7,47 +7,54 @@ using HTML_Entities
7
7
8
8
HE = HTML_Entities
9
9
10
+ he_matchchar (ch) = HE. matchchar (HE. default, ch)
11
+ he_lookupname (nam) = HE. lookupname (HE. default, nam)
12
+ he_longestmatches (str) = HE. longestmatches (HE. default, str)
13
+ he_matches (str) = HE. matches (HE. default, str)
14
+ he_completions (str) = HE. completions (HE. default, str)
15
+
16
+
10
17
@testset " HTML_Entities" begin
11
18
@testset " lookupname" begin
12
- @test HE . lookupname (SubString (" My name is Spock" , 12 )) == " "
13
- @test HE . lookupname (" foobar" ) == " "
14
- @test HE . lookupname (" nle" ) == " \u 2270"
15
- @test HE . lookupname (" Pscr" ) == " \U 1d4ab"
16
- @test HE . lookupname (" lvnE" ) == " \u 2268\u fe00"
19
+ @test he_lookupname (SubString (" My name is Spock" , 12 )) == " "
20
+ @test he_lookupname (" foobar" ) == " "
21
+ @test he_lookupname (" nle" ) == " \u 2270"
22
+ @test he_lookupname (" Pscr" ) == " \U 1d4ab"
23
+ @test he_lookupname (" lvnE" ) == " \u 2268\u fe00"
17
24
end
18
25
19
26
@testset " matches" begin
20
- @test isempty (HE . matches (" " ))
21
- @test isempty (HE . matches (" \u 201f" ))
22
- @test isempty (HE . matches (SubString (" This is \u 201f" , 9 )))
27
+ @test isempty (he_matches (" " ))
28
+ @test isempty (he_matches (" \u 201f" ))
29
+ @test isempty (he_matches (SubString (" This is \u 201f" , 9 )))
23
30
for (chrs, exp) in ((" \u 2270" , [" nle" , " nleq" ]),
24
31
(" \U 1d4ab" , [" Pscr" ]),
25
32
(" \U 1d51e" , [" afr" ]),
26
33
(" \u 2268\u fe00" , [" lvertneqq" , " lvnE" ]))
27
- res = HE . matches (chrs)
34
+ res = he_matches (chrs)
28
35
@test length (res) >= length (exp)
29
36
@test intersect (res, exp) == exp
30
37
end
31
38
end
32
39
33
40
@testset " longestmatches" begin
34
- @test isempty (HE . longestmatches (" \u 201f abcd" ))
35
- @test isempty (HE . longestmatches (SubString (" This is \U 201f abcd" , 9 )))
41
+ @test isempty (he_longestmatches (" \u 201f abcd" ))
42
+ @test isempty (he_longestmatches (SubString (" This is \U 201f abcd" , 9 )))
36
43
for (chrs, exp) in ((" \u 2270 abcd" , [" nle" , " nleq" ]),
37
44
(" \U 1d4ab abcd" , [" Pscr" ]),
38
45
(" \u 2268\u fe00 silly" , [" lvertneqq" , " lvnE" ]))
39
- res = HE . longestmatches (chrs)
46
+ res = he_longestmatches (chrs)
40
47
@test length (res) >= length (exp)
41
48
@test intersect (res, exp) == exp
42
49
end
43
50
end
44
51
45
52
@testset " completions" begin
46
- @test isempty (HE . completions (" ScottPaulJones" ))
47
- @test isempty (HE . completions (SubString (" My name is Scott" , 12 )))
53
+ @test isempty (he_completions (" ScottPaulJones" ))
54
+ @test isempty (he_completions (SubString (" My name is Scott" , 12 )))
48
55
for (chrs, exp) in ((" and" , [" and" , " andand" , " andd" , " andslope" , " andv" ]),
49
56
(" um" , [" umacr" , " uml" ]))
50
- res = HE . completions (chrs)
57
+ res = he_completions (chrs)
51
58
@test length (res) >= length (exp)
52
59
@test intersect (res, exp) == exp
53
60
end
0 commit comments