| 1 | const std = @import("std"); |
| 2 | const htmlentities = @import("htmlentities"); |
| 3 | |
| 4 | test { |
| 5 | try std.testing.expectEqual(@as(usize, 2231), htmlentities.ENTITIES.len); |
| 6 | |
| 7 | const aelig = htmlentities.lookup("&AElig").?; |
| 8 | try std.testing.expectEqualStrings("&AElig", aelig.entity); |
| 9 | try std.testing.expectEqual(htmlentities.Codepoints{ .Single = 198 }, aelig.codepoints); |
| 10 | try std.testing.expectEqualStrings("Æ", aelig.characters); |
| 11 | |
| 12 | const afr = htmlentities.lookup("𝔄").?; |
| 13 | try std.testing.expectEqualStrings("𝔄", afr.entity); |
| 14 | try std.testing.expectEqual(htmlentities.Codepoints{ .Single = 120068 }, afr.codepoints); |
| 15 | try std.testing.expectEqualStrings("𝔄", afr.characters); |
| 16 | |
| 17 | const bnequiv = htmlentities.lookup("≡⃥").?; |
| 18 | try std.testing.expectEqualStrings("≡⃥", bnequiv.entity); |
| 19 | try std.testing.expectEqual(htmlentities.Codepoints{ .Double = [2]u32{ 8801, 8421 } }, bnequiv.codepoints); |
| 20 | try std.testing.expectEqualStrings("\u{2261}\u{20E5}", bnequiv.characters); |
| 21 | } |