2017-07-05 23:10:57 +00:00
|
|
|
/*
|
|
|
|
* 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"
|
|
|
|
|
|
|
|
func TestWinAnsiEncoder(t *testing.T) {
|
|
|
|
enc := NewWinAnsiTextEncoder()
|
|
|
|
|
2017-07-10 15:17:46 +00:00
|
|
|
glyph, found := enc.CharcodeToGlyph(32)
|
2017-07-05 23:10:57 +00:00
|
|
|
if !found || glyph != "space" {
|
|
|
|
t.Errorf("Glyph != space")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-07-10 15:17:46 +00:00
|
|
|
glyph, found = enc.RuneToGlyph('þ')
|
2017-07-05 23:10:57 +00:00
|
|
|
if !found || glyph != "thorn" {
|
|
|
|
t.Errorf("Glyph != thorn")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|