@@ -7,47 +7,54 @@ using HTML_Entities
77
88HE = HTML_Entities
99
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+
1017@testset " HTML_Entities" begin
1118@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"
1724end
1825
1926@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 )))
2330 for (chrs, exp) in ((" \u 2270" , [" nle" , " nleq" ]),
2431 (" \U 1d4ab" , [" Pscr" ]),
2532 (" \U 1d51e" , [" afr" ]),
2633 (" \u 2268\u fe00" , [" lvertneqq" , " lvnE" ]))
27- res = HE . matches (chrs)
34+ res = he_matches (chrs)
2835 @test length (res) >= length (exp)
2936 @test intersect (res, exp) == exp
3037 end
3138end
3239
3340@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 )))
3643 for (chrs, exp) in ((" \u 2270 abcd" , [" nle" , " nleq" ]),
3744 (" \U 1d4ab abcd" , [" Pscr" ]),
3845 (" \u 2268\u fe00 silly" , [" lvertneqq" , " lvnE" ]))
39- res = HE . longestmatches (chrs)
46+ res = he_longestmatches (chrs)
4047 @test length (res) >= length (exp)
4148 @test intersect (res, exp) == exp
4249 end
4350end
4451
4552@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 )))
4855 for (chrs, exp) in ((" and" , [" and" , " andand" , " andd" , " andslope" , " andv" ]),
4956 (" um" , [" umacr" , " uml" ]))
50- res = HE . completions (chrs)
57+ res = he_completions (chrs)
5158 @test length (res) >= length (exp)
5259 @test intersect (res, exp) == exp
5360 end
0 commit comments