Sha256: 9ef1f6fdefe5cb0df12dfdbb79c78b2ce66176d45c5f4dc1497e92da8284b876

Contents?: true

Size: 799 Bytes

Versions: 76

Compression:

Stored size: 799 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'test_helper'
require 'hexapdf/font/encoding/difference_encoding'
require 'hexapdf/font/encoding/win_ansi_encoding'

describe HexaPDF::Font::Encoding::DifferenceEncoding do
  before do
    base = HexaPDF::Font::Encoding::WinAnsiEncoding.new
    @enc = HexaPDF::Font::Encoding::DifferenceEncoding.new(base)
  end

  describe "name" do
    it "takes the encoding differences into account" do
      assert_equal(:A, @enc.name(65))
      @enc.code_to_name[65] = :B
      assert_equal(:B, @enc.name(65))
      assert_equal(:B, @enc.name(66))
    end
  end

  describe "code" do
    it "takes the encoding differences into account" do
      assert_equal(65, @enc.code(:A))
      @enc.code_to_name[65] = :Known
      assert_equal(65, @enc.code(:Known))
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
hexapdf-1.2.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-1.1.1 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-1.1.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-1.0.3 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-1.0.2 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-1.0.1 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-1.0.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.47.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.46.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.45.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.44.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.41.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.40.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.39.1 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.39.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.38.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.37.2 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.37.1 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.37.0 test/hexapdf/font/encoding/test_difference_encoding.rb
hexapdf-0.36.0 test/hexapdf/font/encoding/test_difference_encoding.rb