mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove comments in test file
This commit is contained in:
parent
05633d02d8
commit
a7b6a9553b
1 changed files with 0 additions and 7 deletions
|
@ -58,13 +58,11 @@ class TransliterateTest < ActiveSupport::TestCase
|
||||||
assert_equal "Can only transliterate strings. Received Object", exception.message
|
assert_equal "Can only transliterate strings. Received Object", exception.message
|
||||||
end
|
end
|
||||||
|
|
||||||
# Valid UTF-8 Works
|
|
||||||
def test_transliterate_handles_strings_with_valid_utf8_encodings
|
def test_transliterate_handles_strings_with_valid_utf8_encodings
|
||||||
string = String.new("A", encoding: Encoding::UTF_8)
|
string = String.new("A", encoding: Encoding::UTF_8)
|
||||||
assert_equal "A", ActiveSupport::Inflector.transliterate(string)
|
assert_equal "A", ActiveSupport::Inflector.transliterate(string)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Valid US-ASCII Works
|
|
||||||
def test_transliterate_handles_strings_with_valid_us_ascii_encodings
|
def test_transliterate_handles_strings_with_valid_us_ascii_encodings
|
||||||
string = String.new("A", encoding: Encoding::US_ASCII)
|
string = String.new("A", encoding: Encoding::US_ASCII)
|
||||||
transcoded = ActiveSupport::Inflector.transliterate(string)
|
transcoded = ActiveSupport::Inflector.transliterate(string)
|
||||||
|
@ -72,7 +70,6 @@ class TransliterateTest < ActiveSupport::TestCase
|
||||||
assert_equal Encoding::US_ASCII, transcoded.encoding
|
assert_equal Encoding::US_ASCII, transcoded.encoding
|
||||||
end
|
end
|
||||||
|
|
||||||
# Valid GB18030 Works
|
|
||||||
def test_transliterate_handles_strings_with_valid_gb18030_encodings
|
def test_transliterate_handles_strings_with_valid_gb18030_encodings
|
||||||
string = String.new("A", encoding: Encoding::GB18030)
|
string = String.new("A", encoding: Encoding::GB18030)
|
||||||
transcoded = ActiveSupport::Inflector.transliterate(string)
|
transcoded = ActiveSupport::Inflector.transliterate(string)
|
||||||
|
@ -80,7 +77,6 @@ class TransliterateTest < ActiveSupport::TestCase
|
||||||
assert_equal Encoding::GB18030, transcoded.encoding
|
assert_equal Encoding::GB18030, transcoded.encoding
|
||||||
end
|
end
|
||||||
|
|
||||||
# All other encodings raise argument errors
|
|
||||||
def test_transliterate_handles_strings_with_incompatible_encodings
|
def test_transliterate_handles_strings_with_incompatible_encodings
|
||||||
incompatible_encodings = Encoding.list - [
|
incompatible_encodings = Encoding.list - [
|
||||||
Encoding::UTF_8,
|
Encoding::UTF_8,
|
||||||
|
@ -96,19 +92,16 @@ class TransliterateTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Invalid UTF-8 Works
|
|
||||||
def test_transliterate_handles_strings_with_invalid_utf8_bytes
|
def test_transliterate_handles_strings_with_invalid_utf8_bytes
|
||||||
string = String.new("\255", encoding: Encoding::UTF_8)
|
string = String.new("\255", encoding: Encoding::UTF_8)
|
||||||
assert_equal "?", ActiveSupport::Inflector.transliterate(string)
|
assert_equal "?", ActiveSupport::Inflector.transliterate(string)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Invalid raises exception
|
|
||||||
def test_transliterate_handles_strings_with_invalid_us_ascii_bytes
|
def test_transliterate_handles_strings_with_invalid_us_ascii_bytes
|
||||||
string = String.new("\255", encoding: Encoding::US_ASCII)
|
string = String.new("\255", encoding: Encoding::US_ASCII)
|
||||||
assert_equal "?", ActiveSupport::Inflector.transliterate(string)
|
assert_equal "?", ActiveSupport::Inflector.transliterate(string)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Invalid GB18030 raises exception
|
|
||||||
def test_transliterate_handles_strings_with_invalid_gb18030_bytes
|
def test_transliterate_handles_strings_with_invalid_gb18030_bytes
|
||||||
string = String.new("\255", encoding: Encoding::GB18030)
|
string = String.new("\255", encoding: Encoding::GB18030)
|
||||||
assert_equal "?", ActiveSupport::Inflector.transliterate(string)
|
assert_equal "?", ActiveSupport::Inflector.transliterate(string)
|
||||||
|
|
Loading…
Reference in a new issue