Sha256: 8334b44687337576d279ab39dba82516dceb799624ae3ed6e40b5d7ebd5da6ec

Contents?: true

Size: 1.18 KB

Versions: 136

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'
require 'tins/xt'

module Tins
  if defined? ::Encoding
    class StringByteOrderMarkTest < Test::Unit::TestCase
      def test_no_bom_encoding
        assert_nil "abcdef".bom_encoding
      end

      def test_utf8_bom_encoding
        assert_equal Encoding::UTF_8, "\xef\xbb\xbf".bom_encoding
      end

      def test_utf16be_bom_encoding
        assert_equal Encoding::UTF_16BE, "\xfe\xff".bom_encoding
      end

      def test_utf16le_bom_encoding
        assert_equal Encoding::UTF_16LE, "\xff\xfe".bom_encoding
      end

      def test_utf32be_bom_encoding
        assert_equal Encoding::UTF_32BE, "\x00\x00\xff\xfe".bom_encoding
      end

      def test_utf32le_bom_encoding
        assert_equal Encoding::UTF_32LE, "\xff\xfe\x00\x00".bom_encoding
      end

      def test_utf7_bom_encoding
        assert_equal Encoding::UTF_7, "\x2b\x2f\x76\x38".bom_encoding
        assert_equal Encoding::UTF_7, "\x2b\x2f\x76\x39".bom_encoding
        assert_equal Encoding::UTF_7, "\x2b\x2f\x76\x2b".bom_encoding
        assert_equal Encoding::UTF_7, "\x2b\x2f\x76\x2f".bom_encoding
        assert_equal Encoding::UTF_7, "\x2b\x2f\x76\x38\x2d".bom_encoding
      end
    end
  end
end

Version data entries

136 entries across 118 versions & 9 rubygems

Version Path
tins-1.4.1 tests/string_byte_order_mark_test.rb
tins-1.4.0 tests/string_byte_order_mark_test.rb
tins-1.3.5 tests/string_byte_order_mark_test.rb
tins-1.3.4 tests/string_byte_order_mark_test.rb
tins-1.3.3 tests/string_byte_order_mark_test.rb
tins-1.3.2 tests/string_byte_order_mark_test.rb
tins-1.3.1 tests/string_byte_order_mark_test.rb
tins-1.3.0 tests/string_byte_order_mark_test.rb
tins-1.2.0 tests/string_byte_order_mark_test.rb
tins-1.1.0 tests/string_byte_order_mark_test.rb
tins-1.0.1 tests/string_byte_order_mark_test.rb
tins-1.0.0 tests/string_byte_order_mark_test.rb
tins-0.13.2 tests/string_byte_order_mark_test.rb
social_url_stats-0.0.1 vendor/ruby/1.9.1/gems/tins-0.13.1/tests/string_byte_order_mark_test.rb
tins-0.13.1 tests/string_byte_order_mark_test.rb
tins-0.13.0 tests/string_byte_order_mark_test.rb