update test_match.py

Add tests for the following issues:
  http://bugs.ruby-lang.org/issues/7972
  http://bugs.ruby-lang.org/issues/7974
  http://bugs.ruby-lang.org/issues/8001
  http://bugs.ruby-lang.org/issues/8023