code: def test_map(self) -> None:
      def f(n: int) -> int:
          return n + 1
  
      def g(val: str) -> int:
          return len(val)
  
      def h() -> int:
          return -1
  
      self.assertEqual(self.ok.map(op=f), Ok(1))
      self.assertEqual(self.ok.map_err(op=g), Ok(0))
      self.assertEqual(self.ok.map_or(default="foo", op=f), 1)
      self.assertEqual(self.ok.map_or_else(default_op=h, op=f), 1)
  
      self.assertEqual(self.err.map(op=f), Err("yikes"))
      self.assertEqual(self.err.map_err(op=g), Err(5))
      self.assertEqual(self.err.map_or(default="foo", op=f), "foo")
      self.assertEqual(self.err.map_or_else(default_op=h, op=f), -1)
  
file_path: Ax/ax/utils/common/tests/test_result.py
imports: from ax.utils.common.result import Err, Ok, Result, UnwrapError
  from ax.utils.common.testutils import TestCase
label_desc: Use image node_id 5 for calling the ResultTest obj's underlying member method code with example usage: obj.test_map() and returns: unknown, len, unknown