diff options
| -rw-r--r-- | benchmark/bm_app_lc_fizzbuzz.rb | 3 | ||||
| -rw-r--r-- | mrbgems/mruby-io/test/file.rb | 16 | ||||
| -rw-r--r-- | mrbgems/mruby-io/test/gc_filedes.sh | 4 | ||||
| -rw-r--r-- | mrbgems/mruby-io/test/io.rb | 20 | ||||
| -rw-r--r-- | mrbgems/mruby-print/mrblib/print.rb | 3 | ||||
| -rw-r--r-- | mrbgems/mruby-print/src/print.c | 1 |
6 files changed, 9 insertions, 38 deletions
diff --git a/benchmark/bm_app_lc_fizzbuzz.rb b/benchmark/bm_app_lc_fizzbuzz.rb index 26283cc3f..de8268577 100644 --- a/benchmark/bm_app_lc_fizzbuzz.rb +++ b/benchmark/bm_app_lc_fizzbuzz.rb @@ -48,5 +48,4 @@ answer = to_array(solution).map do |p| to_string(p) end -answer_str = answer.to_a -# puts answer_str +# puts answer diff --git a/mrbgems/mruby-io/test/file.rb b/mrbgems/mruby-io/test/file.rb index 8d2be04c8..7b67ded26 100644 --- a/mrbgems/mruby-io/test/file.rb +++ b/mrbgems/mruby-io/test/file.rb @@ -1,16 +1,16 @@ ## -# IO Test +# File Test -assert('File', '15.2.21') do - File.class == Class +assert('File TEST SETUP') do + MRubyIOTestUtil.io_test_setup end -assert('File', '15.2.21.2') do - File.superclass == IO +assert('File', '15.2.21') do + assert_equal Class, File.class end -assert('File TEST SETUP') do - MRubyIOTestUtil.io_test_setup +assert('File', '15.2.21.2') do + assert_equal IO, File.superclass end assert('File#initialize', '15.2.21.4.1') do @@ -27,7 +27,7 @@ assert('File#path', '15.2.21.4.2') do assert_equal $mrbtest_io_rfname, io.path io.close assert_equal $mrbtest_io_rfname, io.path - io.closed? + assert_true io.closed? end assert('File.basename') do diff --git a/mrbgems/mruby-io/test/gc_filedes.sh b/mrbgems/mruby-io/test/gc_filedes.sh deleted file mode 100644 index 6e5d1bbf1..000000000 --- a/mrbgems/mruby-io/test/gc_filedes.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -ulimit -n 20 -mruby -e '100.times { File.open "'$0'" }' diff --git a/mrbgems/mruby-io/test/io.rb b/mrbgems/mruby-io/test/io.rb index e4a449696..881e94185 100644 --- a/mrbgems/mruby-io/test/io.rb +++ b/mrbgems/mruby-io/test/io.rb @@ -1,26 +1,6 @@ ## # IO Test -unless Object.respond_to? :assert_nothing_raised - def assert_nothing_raised(*exp) - ret = true - if $mrbtest_assert - $mrbtest_assert_idx += 1 - msg = exp.last.class == String ? exp.pop : "" - begin - yield - rescue Exception => e - msg = "#{msg} exception raised." - diff = " Class: <#{e.class}>\n" + - " Message: #{e.message}" - $mrbtest_assert.push([$mrbtest_assert_idx, msg, diff]) - ret = false - end - end - ret - end -end - assert('IO TEST SETUP') do MRubyIOTestUtil.io_test_setup $cr = MRubyIOTestUtil.win? ? 1 : 0 # "\n" include CR or not diff --git a/mrbgems/mruby-print/mrblib/print.rb b/mrbgems/mruby-print/mrblib/print.rb index fa83c47de..27567d858 100644 --- a/mrbgems/mruby-print/mrblib/print.rb +++ b/mrbgems/mruby-print/mrblib/print.rb @@ -52,9 +52,6 @@ module Kernel def printf(*args) raise NotImplementedError.new('printf not available') end - def sprintf(*args) - raise NotImplementedError.new('sprintf not available') - end else def printf(*args) __printstr__(sprintf(*args)) diff --git a/mrbgems/mruby-print/src/print.c b/mrbgems/mruby-print/src/print.c index e181b06e0..f7f99fc77 100644 --- a/mrbgems/mruby-print/src/print.c +++ b/mrbgems/mruby-print/src/print.c @@ -23,7 +23,6 @@ printstr(mrb_state *mrb, mrb_value obj) char* utf8 = RSTRING_PTR(obj); int wlen = MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, NULL, 0); wchar_t* utf16 = (wchar_t*)mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t)); - if (utf16 == NULL) return; if (MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, utf16, wlen) > 0) { utf16[wlen] = 0; WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), |
