source: EcnlProtoTool/trunk/mruby-1.3.0/test/t/unicode.rb@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 1.1 KB
Line 
1# Test of the \u notation
2
3assert('bare \u notation test') do
4 # Mininum and maximum one byte characters
5 assert_equal("\x00", "\u0000")
6 assert_equal("\x7F", "\u007F")
7
8 # Mininum and maximum two byte characters
9 assert_equal("\xC2\x80", "\u0080")
10 assert_equal("\xDF\xBF", "\u07FF")
11
12 # Mininum and maximum three byte characters
13 assert_equal("\xE0\xA0\x80", "\u0800")
14 assert_equal("\xEF\xBF\xBF", "\uFFFF")
15
16 # Four byte characters require the \U notation
17end
18
19assert('braced \u notation test') do
20 # Mininum and maximum one byte characters
21 assert_equal("\x00", "\u{0000}")
22 assert_equal("\x7F", "\u{007F}")
23
24 # Mininum and maximum two byte characters
25 assert_equal("\xC2\x80", "\u{0080}")
26 assert_equal("\xDF\xBF", "\u{07FF}")
27
28 # Mininum and maximum three byte characters
29 assert_equal("\xE0\xA0\x80", "\u{0800}")
30 assert_equal("\xEF\xBF\xBF", "\u{FFFF}")
31
32 # Mininum and maximum four byte characters
33 assert_equal("\xF0\x90\x80\x80", "\u{10000}")
34 assert_equal("\xF4\x8F\xBF\xBF", "\u{10FFFF}")
35end
36
37assert('braced multiple \u notation test') do
38 assert_equal("ABC", "\u{41 42 43}")
39end
Note: See TracBrowser for help on using the repository browser.