Last change
on this file since 462 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:
715 bytes
|
Rev | Line | |
---|
[331] | 1 | assert("Kernel.require") do
|
---|
| 2 | # see d/required.rb
|
---|
| 3 | $gvar1 = 0
|
---|
| 4 | lvar1 = 0
|
---|
| 5 | class MrubyRequireClass; end
|
---|
| 6 |
|
---|
| 7 | assert_true require(File.join(File.dirname(__FILE__), "d", "required.rb"))
|
---|
| 8 |
|
---|
| 9 | # Kernel.require can create a global variable
|
---|
| 10 | assert_equal 1, $gvar0
|
---|
| 11 |
|
---|
| 12 | # Kernel.require can change value of a global variable
|
---|
| 13 | assert_equal 1, $gvar1
|
---|
| 14 |
|
---|
| 15 | # Kernel.require cannot create a local variable
|
---|
| 16 | assert_raise(NoMethodError) do
|
---|
| 17 | lvar0
|
---|
| 18 | end
|
---|
| 19 |
|
---|
| 20 | # Kernel.require cannot change value of a local variable
|
---|
| 21 | assert_equal 0, lvar1
|
---|
| 22 |
|
---|
| 23 | # Kernel.require can define a toplevel procedure
|
---|
| 24 | assert_equal :proc0, proc0
|
---|
| 25 |
|
---|
| 26 | # Kernel.require can add a method to an existing class
|
---|
| 27 | assert_equal :foo, MrubyRequireClass.new.foo
|
---|
| 28 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.