link method

  1. @override
bool link(
  1. Cell link, {
  2. C? cell,
})
inherited

Validates a cell link against test rules

Implementation

@override
bool link(Cell link, {C? cell}) {

  final checked = Set<TestRule>.identity();

  bool process(TestRule rule) {
    if (rule is TestObject<C>) {
      for (var r in rule) {
        if (process(r) == false) {
          return false;
        }
      }
    }

    if (rule is TestLinkRule<C> && checked.add(rule)) {
      try {
        if (rule.link(link, cell: cell) == false) {
          return false;
        }
      } catch(_) {}
    }
    return true;
  }
  return process(this);
}