~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to test/ruby/test_encoding.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
      assert_equal(e, Encoding.find(e.name.upcase))
14
14
      assert_equal(e, Encoding.find(e.name.capitalize))
15
15
      assert_equal(e, Encoding.find(e.name.downcase))
 
16
      assert_equal(e, Encoding.find(e))
16
17
    end
17
18
  end
18
19
 
41
42
    assert_nothing_raised{Encoding.find("locale")}
42
43
    assert_nothing_raised{Encoding.find("filesystem")}
43
44
 
44
 
    if /(?:ms|dar)win/ !~ RUBY_PLATFORM
 
45
    if /(?:ms|dar)win|mingw/ !~ RUBY_PLATFORM
45
46
      # Unix's filesystem encoding is default_external
46
47
      assert_ruby_status(%w[-EUTF-8:EUC-JP], <<-'EOS')
47
48
        exit Encoding.find("filesystem") == Encoding::UTF_8
95
96
    str2 = Marshal.load(Marshal.dump(str2))
96
97
    assert_equal(str, str2, '[ruby-dev:38596]')
97
98
  end
 
99
 
 
100
  def test_unsafe
 
101
    bug5279 = '[ruby-dev:44469]'
 
102
    assert_ruby_status([], '$SAFE=3; "a".encode("utf-16be")', bug5279)
 
103
  end
98
104
end