Changeset 331 for EcnlProtoTool/trunk/mruby-1.3.0/test/t/unicode.rb
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/test/t/unicode.rb
r321 r331 3 3 assert('bare \u notation test') do 4 4 # Mininum and maximum one byte characters 5 assert_equal("\ u0000", "\x00")6 assert_equal("\ u007F", "\x7F")5 assert_equal("\x00", "\u0000") 6 assert_equal("\x7F", "\u007F") 7 7 8 8 # Mininum and maximum two byte characters 9 assert_equal("\ u0080", "\xC2\x80")10 assert_equal("\ u07FF", "\xDF\xBF")9 assert_equal("\xC2\x80", "\u0080") 10 assert_equal("\xDF\xBF", "\u07FF") 11 11 12 12 # Mininum and maximum three byte characters 13 assert_equal("\ u0800", "\xE0\xA0\x80")14 assert_equal("\ uFFFF", "\xEF\xBF\xBF")13 assert_equal("\xE0\xA0\x80", "\u0800") 14 assert_equal("\xEF\xBF\xBF", "\uFFFF") 15 15 16 16 # Four byte characters require the \U notation … … 19 19 assert('braced \u notation test') do 20 20 # Mininum and maximum one byte characters 21 assert_equal("\ u{0000}", "\x00")22 assert_equal("\ u{007F}", "\x7F")21 assert_equal("\x00", "\u{0000}") 22 assert_equal("\x7F", "\u{007F}") 23 23 24 24 # Mininum and maximum two byte characters 25 assert_equal("\ u{0080}", "\xC2\x80")26 assert_equal("\ u{07FF}", "\xDF\xBF")25 assert_equal("\xC2\x80", "\u{0080}") 26 assert_equal("\xDF\xBF", "\u{07FF}") 27 27 28 28 # Mininum and maximum three byte characters 29 assert_equal("\ u{0800}", "\xE0\xA0\x80")30 assert_equal("\ u{FFFF}", "\xEF\xBF\xBF")29 assert_equal("\xE0\xA0\x80", "\u{0800}") 30 assert_equal("\xEF\xBF\xBF", "\u{FFFF}") 31 31 32 32 # Mininum and maximum four byte characters 33 assert_equal("\ u{10000}", "\xF0\x90\x80\x80")34 assert_equal("\ u{10FFFF}", "\xF4\x8F\xBF\xBF")33 assert_equal("\xF0\x90\x80\x80", "\u{10000}") 34 assert_equal("\xF4\x8F\xBF\xBF", "\u{10FFFF}") 35 35 end 36 37 assert('braced multiple \u notation test') do 38 assert_equal("ABC", "\u{41 42 43}") 39 end
Note:
See TracChangeset
for help on using the changeset viewer.