unipdf/pdf/model/textencoding/glyph_test.go
Peter Williams 199a74dbd8 Major changes to font code
- Added Type1 font parsing.
- Added Standard 14 font parsing.
- Fixed some bugs in cmap code.
- Started re-structuring of font code. Moved common font fields to `fontSkeleton`
2018-06-27 12:25:59 +10:00

28 lines
664 B
Go

/*
* This file is subject to the terms and conditions defined in
* file 'LICENSE.md', which is part of this source code package.
*/
package textencoding
import (
"testing"
)
// TestGlypRune tests that glyphlistGlyphToRuneMap and glyphlistRuneToGlyphMap match
func TestGlypRune(t *testing.T) {
for r, g := range glyphlistRuneToGlyphMap {
r2, ok := glyphlistGlyphToRuneMap[g]
if !ok {
t.Errorf("rune→glyph→rune mismatch: %s → %q → %s", rs(r), g, rs(r2))
}
}
for g, r := range glyphlistGlyphToRuneMap {
g2, ok := glyphlistRuneToGlyphMap[r]
if !ok {
t.Errorf("glyph→rune→glyph mismatch: %q → %s → %q", g, rs(r), g2)
}
}
}