summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-mruby/bintest/mruby.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-11-30 21:08:54 +0900
committerGitHub <[email protected]>2019-11-30 21:08:54 +0900
commit25b5b79cc3cfff956d107452b67aeb4d57c78202 (patch)
tree1e4702396e54d9d08747922ac53989a1396f7b5c /mrbgems/mruby-bin-mruby/bintest/mruby.rb
parent5eb08a0d1a936688ee8b928e693f0ed085831315 (diff)
parent49653b81ea978a5f02c4a6ce1ed53eb1cd0dbe7a (diff)
downloadmruby-25b5b79cc3cfff956d107452b67aeb4d57c78202.tar.gz
mruby-25b5b79cc3cfff956d107452b67aeb4d57c78202.zip
Merge pull request #4847 from shuujii/quit-mruby-v-immediately-if-no-program-is-given
Quit `mruby -v` immediately if no program is given for Ruby compatibility
Diffstat (limited to 'mrbgems/mruby-bin-mruby/bintest/mruby.rb')
-rw-r--r--mrbgems/mruby-bin-mruby/bintest/mruby.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-mruby/bintest/mruby.rb b/mrbgems/mruby-bin-mruby/bintest/mruby.rb
index f63ac9a30..4edfd04c3 100644
--- a/mrbgems/mruby-bin-mruby/bintest/mruby.rb
+++ b/mrbgems/mruby-bin-mruby/bintest/mruby.rb
@@ -128,6 +128,12 @@ assert('mruby -r option (file not found)') do
assert_mruby("", /\A.*: Cannot open library file: .*\n\z/, false, %w[-r _no_exists_])
end
+assert('mruby -v option') do
+ ver_re = /\Amruby \d+\.\d+\.\d+ \(\d+-\d+-\d+\)\n/
+ assert_mruby(/#{ver_re}\z/, "", true, %w[-v])
+ assert_mruby(/#{ver_re}^[^\n]*NODE.*\n:end\n\z/m, "", true, %w[-v -e p(:end)])
+end
+
assert('mruby --verbose option') do
assert_mruby(/\A[^\n]*NODE.*\n:end\n\z/m, "", true, %w[--verbose -e p(:end)])
end