code: def test_splitext_addext():
      res = splitext_addext("fname.ext.gz")
      assert res == ("fname", ".ext", ".gz")
      res = splitext_addext("fname.ext")
      assert res == ("fname", ".ext", "")
      res = splitext_addext("fname.ext.foo", (".foo", ".bar"))
      assert res == ("fname", ".ext", ".foo")
      res = splitext_addext("fname.ext.FOO", (".foo", ".bar"))
      assert res == ("fname", ".ext", ".FOO")
      # case sensitive
      res = splitext_addext("fname.ext.FOO", (".foo", ".bar"), True)
      assert res == ("fname.ext", ".FOO", "")
      # edge cases
      res = splitext_addext(".nii")
      assert res == ("", ".nii", "")
      res = splitext_addext("...nii")
      assert res == ("..", ".nii", "")
      res = splitext_addext(".")
      assert res == (".", "", "")
      res = splitext_addext("..")
      assert res == ("..", "", "")
      res = splitext_addext("...")
      assert res == ("...", "", "")
  
imports: import pathlib
  import pytest
  from ..filename_parser import TypesFilenamesError, _stringify_path, parse_filename, splitext_addext, types_filenames
label_desc: Use image node_id 3 for calling a global function with example usage: test_splitext_addext() without return types