buruzaemon / natto

A Tasty Ruby Binding with MeCab
BSD 2-Clause "Simplified" License
143 stars 16 forks source link

Refactor test #71

Closed pocke closed 5 years ago

pocke commented 5 years ago

This pull request will suppress Ruby warnings in the tests. Currently this project has some Ruby warnings. We can confirm them with RUBYOPT=-w.

$ RUBYOPT=-w bundle exec rake
/home/pocke/.rbenv/versions/trunk/bin/ruby  test/test_natto.rb 
/home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_dictionaryinfo.rb:61: warning: possibly useless use of a literal in void context
/home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_dictionaryinfo.rb:62: warning: possibly useless use of a literal in void context
/home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_dictionaryinfo.rb:15: warning: assigned but unused variable - usrdic
/home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_mecab.rb:281: warning: assigned but unused variable - out
Run options: --seed 63625

# Running:

..........:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
.........................../home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_dictionaryinfo.rb:8: warning: instance variable @testdic not initialized
[INFO] setup: could not delete test.dic, you might want to remove manually.
reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
./home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_dictionaryinfo.rb:8: warning: instance variable @testdic not initialized
[INFO] setup: could not delete test.dic, you might want to remove manually.
reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
/home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_dictionaryinfo.rb:8: warning: instance variable @testdic not initialized
[INFO] setup: could not delete test.dic, you might want to remove manually.
.reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
/home/pocke/ghq/github.com/buruzaemon/natto/test/natto/tc_dictionaryinfo.rb:8: warning: instance variable @testdic not initialized
[INFO] setup: could not delete test.dic, you might want to remove manually.
.reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
...:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
.

Finished in 1.037865s, 42.3947 runs/s, 611.8331 assertions/s.

44 runs, 635 assertions, 0 failures, 0 errors, 0 skips

After this pull request, it displays test result without Ruby warnings.

$ RUBYOPT=-w bundle exec rake 
/home/pocke/.rbenv/versions/trunk/bin/ruby  test/test_natto.rb 
Run options: --seed 29586

# Running:

....:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
...............................reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
.reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
.reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
.reading /home/pocke/ghq/github.com/buruzaemon/natto/test/natto/test_userdic.csv ... 1
emitting double-array: 100% |###########################################| 

done!
.....:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
:lattice-level is DEPRECATED, please use :marginal or :nbest
.

Finished in 1.064655s, 41.3279 runs/s, 596.4374 assertions/s.

44 runs, 635 assertions, 0 failures, 0 errors, 0 skips
pocke commented 5 years ago

CI is failed in JRuby. #72 will fix it.

buruzaemon commented 5 years ago

I will have a look into this issue this weekend, @pocke. Thank you for raising this one, too!