source: EcnlProtoTool/trunk/mrbgems/mruby-errno/test/errno.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
File size: 1.5 KB
Line 
1assert('Errno') do
2 Errno.class == Module
3end
4
5assert('SystemCallError') do
6 SystemCallError.class == Class
7end
8
9assert('SystemCallError superclass') do
10 SystemCallError.superclass == StandardError
11end
12
13assert('SystemCallError#initialize') do
14 SystemCallError.new("a").message == "unknown error - a" and
15 SystemCallError.new("a", 12345).message == "Unknown error: 12345 - a" and
16 SystemCallError.new(12345).message == "Unknown error: 12345"
17end
18
19assert('SystemCallError#errno') do
20 assert_equal 1, SystemCallError.new("a", 1).errno
21 assert_equal 1, SystemCallError.new(1).errno
22 assert_equal 12345, SystemCallError.new("a", 12345).errno
23 assert_equal 23456, SystemCallError.new(23456).errno
24end
25
26assert('SystemCallError#inspect') do
27 SystemCallError.new("a").inspect == "SystemCallError: unknown error - a"
28 end
29
30assert('Errno::NOERROR') do
31 Errno::NOERROR.class == Class
32end
33
34# Is there any platform does not have EPERM?
35assert('Errno::EPERM') do
36 Errno::EPERM.class == Class
37end
38
39assert('Errno::EPERM superclass') do
40 Errno::EPERM.superclass == SystemCallError
41end
42
43assert('Errno::EPERM::Errno') do
44 Errno::EPERM::Errno.is_a? Fixnum
45end
46
47assert('Errno::EPERM#message') do
48 msg = Errno::EPERM.new.message
49 Errno::EPERM.new("a").message == "#{msg} - a"
50end
51
52assert('Errno::EPERM#inspect 1') do
53 msg = Errno::EPERM.new.message
54 Errno::EPERM.new.inspect == "Errno::EPERM: #{msg}"
55end
56
57assert('Errno::EPERM#inspect 2') do
58 msg = Errno::EPERM.new.message
59 Errno::EPERM.new("a").inspect == "Errno::EPERM: #{msg} - a"
60end
Note: See TracBrowser for help on using the repository browser.