Sha256: 0a00d861d248d388404e70d98ea022f27f263c0f6ba054a87202cf555924899b

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

require File.expand_path("../utils.rb", __FILE__)

class TestIconv::Option < TestIconv
  def test_ignore_option
    begin
      iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
      iconv.transliterate?
    rescue NotImplementedError
      return
    end
    iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
    str = iconv.iconv(EUCJ_STR)
    str << iconv.iconv(nil)
    assert_equal(SJIS_STR, str)
    iconv.close

    iconv = Iconv.new('SHIFT_JIS//IGNORE', 'EUC-JP//ignore')
    str = iconv.iconv(EUCJ_STR)
    str << iconv.iconv(nil)
    assert_equal(SJIS_STR, str)
    iconv.close
  end

  def test_translit_option
    begin
      iconv = Iconv.new('SHIFT_JIS', 'EUC-JP')
      iconv.transliterate?
    rescue NotImplementedError
      return
    end
    iconv = Iconv.new('SHIFT_JIS', 'EUC-JP//ignore')
    str = iconv.iconv(EUCJ_STR)
    str << iconv.iconv(nil)
    assert_equal(SJIS_STR, str)
    iconv.close

    iconv = Iconv.new('SHIFT_JIS//TRANSLIT', 'EUC-JP//translit//ignore')
    str = iconv.iconv(EUCJ_STR)
    str << iconv.iconv(nil)
    assert_equal(SJIS_STR, str)
    iconv.close
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
iconv-1.1.0 test/test_option.rb
iconv-1.0.8 test/test_option.rb
iconv-1.0.7 test/test_option.rb
iconv-1.0.6 test/test_option.rb
iconv-1.0.5 test/test_option.rb
iconv-1.0.4 test/test_option.rb
iconv-1.0.3 test/test_option.rb
iconv-1.0.2 test/test_option.rb