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.38.0 tests/string_byte_order_mark_test.rb
tins-1.37.1 tests/string_byte_order_mark_test.rb
tins-1.37.0 tests/string_byte_order_mark_test.rb
tins-1.36.1 tests/string_byte_order_mark_test.rb
tins-1.36.0 tests/string_byte_order_mark_test.rb
tins-1.35.0 tests/string_byte_order_mark_test.rb
tins-1.34.0 tests/string_byte_order_mark_test.rb
tins-1.33.0 tests/string_byte_order_mark_test.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/tins-1.31.1/tests/string_byte_order_mark_test.rb
tins-1.32.1 tests/string_byte_order_mark_test.rb
tins-1.32.0 tests/string_byte_order_mark_test.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/tins-1.31.1/tests/string_byte_order_mark_test.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/tins-1.31.1/tests/string_byte_order_mark_test.rb
tins-1.31.1 tests/string_byte_order_mark_test.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/tins-1.31.0/tests/string_byte_order_mark_test.rb
tins-1.31.0 tests/string_byte_order_mark_test.rb
tins-1.30.0 tests/string_byte_order_mark_test.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/tins-1.29.1/tests/string_byte_order_mark_test.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/tins-1.29.1/tests/string_byte_order_mark_test.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/tins-1.29.1/tests/string_byte_order_mark_test.rb