code: def test_version():
      # Check the correctness of the convenience function
      # and the format of version numbers
  
      def test(name, function):
          version = features.version(name)
          if not features.check(name):
              assert version is None
          else:
              assert function(name) == version
              if name != "PIL":
                  assert version is None or re.search(
                      r"\d+(\.\d+)*$", version
                  )
  
      for module in features.modules:
          test(module, features.version_module)
      for codec in features.codecs:
          test(codec, features.version_codec)
      for feature in features.features:
          test(feature, features.version_feature)
  
file_path: pillow/Tests/test_features.py
imports: from __future__ import annotations
  import io
  import re
  import pytest
  from PIL import features
  from .helper import skip_unless_feature
label_desc: Use image node_id 2 for calling a global function with example usage: test_version() without return types