Fossil.cx = Fossil.createContext()
scope {
  const F = Fossil
  var fn = __FILE
  var st = F.file.stat(fn);
  assert 'object' === typename st
  assert st.name === __FILE
  print('stat() says: ',st);

  const cx = F.cx
  assert cx.db.checkout.filename &&
         cx.db.repo.filename &&
         (cx.db.checkout.filename !== cx.db.repo.filename)

  print("Fossil.file.dirPart()...");
  const dp = F.file.dirPart
  assert 'foo/' === dp('foo/bar')
  assert 'foo/' === dp('foo/')
  assert 'foo' === dp('foo/',false)
  assert 'foo' === dp('foo/bar', false)
  assert null === dp('foo')
  print(dp('foo/',false))

  assert F.rc.MISUSE === catch{dp('')}.code
  assert F.rc.MISUSE === catch{dp(null)}.code
} 

