code: def test_targets_single_dir(tmp_dir, scm, dvc):
      setup_targets_test(tmp_dir)
  
      dir_checksum = "5fb6b29836c388e093ca0715c872fe2a.dir"
  
      expected_result = {
          "added": [
              {"path": os.path.join("dir", ""), "hash": dir_checksum},
              {"path": os.path.join("dir", "1"), "hash": digest("1")},
              {"path": os.path.join("dir", "2"), "hash": digest("2")},
          ],
          "deleted": [],
          "modified": [],
          "not in cache": [],
          "renamed": [],
      }
  
      assert dvc.diff(targets=["dir"]) == expected_result
      assert dvc.diff(targets=["dir" + os.path.sep]) == expected_result
  
imports: import hashlib
  import os
  import pytest
  from funcy import first
  from dvc.exceptions import DvcException
  from dvc.utils.fs import remove
label_desc: Use image node_id 20 for calling a global function with example usage: test_targets_single_dir(tmp_dir, scm, dvc) without return types