(b *testing.B)
| 75 | } |
| 76 | |
| 77 | func BenchmarkParseEntityMap(b *testing.B) { |
| 78 | directive := &xmlparser.Directive{ |
| 79 | Data: []byte(`<!DOCTYPE svg [ |
| 80 | <!ENTITY entity1 "Value1"> |
| 81 | <!ENTITY entity2 'Value2'> |
| 82 | <!ENTITY entity3 "Value with spaces"> |
| 83 | ]>`), |
| 84 | } |
| 85 | |
| 86 | nodes := []xmlparser.Token{directive} |
| 87 | |
| 88 | b.ResetTimer() |
| 89 | |
| 90 | for b.Loop() { |
| 91 | _ = xmlparser.ParseEntityMap(nodes) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func BenchmarkReplaceEntitiesString(b *testing.B) { |
| 96 | em := map[string][]byte{ |
nothing calls this directly
no test coverage detected