* test/ruby/test_m17n.rb (test_magic_comment): add test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
73e3ea958d
commit
c7c263eefc
@ -1,3 +1,7 @@
|
|||||||
|
Mon Jan 28 10:25:59 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/ruby/test_m17n.rb (test_magic_comment): add test.
|
||||||
|
|
||||||
Mon Jan 28 09:34:54 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Jan 28 09:34:54 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* common.mk (help): use double quotes for nmake.
|
* common.mk (help): use double quotes for nmake.
|
||||||
|
@ -1027,4 +1027,11 @@ class TestM17N < Test::Unit::TestCase
|
|||||||
t = r.source
|
t = r.source
|
||||||
assert_equal(s, t, "[ruby-dev:33377] Regexp.new(#{encdump s}).source")
|
assert_equal(s, t, "[ruby-dev:33377] Regexp.new(#{encdump s}).source")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_magic_comment
|
||||||
|
assert_equal(Encoding::US_ASCII, eval("__ENCODING__".force_encoding("US-ASCII")))
|
||||||
|
assert_equal(Encoding::ASCII_8BIT, eval("__ENCODING__".force_encoding("ASCII-8BIT")))
|
||||||
|
assert_equal(Encoding::US_ASCII, eval("# -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT")))
|
||||||
|
assert_equal(Encoding::ASCII_8BIT, eval("# -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user