github.com/unidoc/unidoc@v2.2.0+incompatible/pdf/model/textencoding/winansi_test.go (about)

     1  /*
     2   * This file is subject to the terms and conditions defined in
     3   * file 'LICENSE.md', which is part of this source code package.
     4   */
     5  
     6  package textencoding
     7  
     8  import "testing"
     9  
    10  func TestWinAnsiEncoder(t *testing.T) {
    11  	enc := NewWinAnsiTextEncoder()
    12  
    13  	glyph, found := enc.CharcodeToGlyph(32)
    14  	if !found || glyph != "space" {
    15  		t.Errorf("Glyph != space")
    16  		return
    17  	}
    18  
    19  	glyph, found = enc.RuneToGlyph('รพ')
    20  	if !found || glyph != "thorn" {
    21  		t.Errorf("Glyph != thorn")
    22  		return
    23  	}
    24  }