code: def test_compile_matchers():
      # exact matching
      pat = compile_matchers(["hello.py"]).pop()
      assert pat("hello.py")
      assert not pat("hello-py")
      assert not pat("subdir/hello.py")
  
      # wild card (*)
      pat = compile_matchers(["hello.*"]).pop()
      assert pat("hello.py")
      assert pat("hello.rst")
  
      pat = compile_matchers(["*.py"]).pop()
      assert pat("hello.py")
      assert pat("world.py")
      assert not pat("subdir/hello.py")
  
      # wild card (**)
      pat = compile_matchers(["hello.**"]).pop()
      assert pat("hello.py")
      assert pat("hello.rst")
      assert pat("hello.py/world.py")
  
      pat = compile_matchers(["**.py"]).pop()
      assert pat("hello.py")
      assert pat("world.py")
      assert pat("subdir/hello.py")
  
      pat = compile_matchers(["**/hello.py"]).pop()
      assert not pat("hello.py")
      assert pat("subdir/hello.py")
      assert pat("subdir/subdir/hello.py")
  
      # wild card (?)
      pat = compile_matchers(["hello.?"]).pop()
      assert pat("hello.c")
      assert not pat("hello.py")
  
      # pattern ([...])
      pat = compile_matchers(["hello[12\\].py"]).pop()
      assert pat("hello1.py")
      assert pat("hello2.py")
      assert pat("hello\\.py")
      assert not pat("hello3.py")
  
      pat = compile_matchers(
          ["hello[^12].py"]
      ).pop()  # "^" is not negative identifier
      assert pat("hello1.py")
      assert pat("hello2.py")
      assert pat("hello^.py")
      assert not pat("hello3.py")
  
      # negative pattern ([!...])
      pat = compile_matchers(["hello[!12].py"]).pop()
      assert not pat("hello1.py")
      assert not pat("hello2.py")
      assert not pat(
          "hello/.py"
      )  # negative pattern does not match to "/"
      assert pat("hello3.py")
  
      # non patterns
      pat = compile_matchers(["hello[.py"]).pop()
      assert pat("hello[.py")
      assert not pat("hello.py")
  
      pat = compile_matchers(["hello[].py"]).pop()
      assert pat("hello[].py")
      assert not pat("hello.py")
  
      pat = compile_matchers(["hello[!].py"]).pop()
      assert pat("hello[!].py")
      assert not pat("hello.py")
  
file_path: sphinx/tests/test_util/test_util_matching.py
imports: from sphinx.util.matching import Matcher, compile_matchers, get_matching_files
label_desc: Use image node_id 1 for calling a global function with example usage: test_compile_matchers() without return types