anchor.diff:        expect(stack.removeLast(), name, reason: 'Non-matching start element.');
       },
       onCharacterData: (text) {
  +      expect(state, 1, reason: 'Reader not started');
         expect(nodes, isNotEmpty, reason: 'Missing element in node list.');
         XmlNode node = nodes.removeAt(0);
         expect(node.nodeType, anyOf(XmlNodeType.TEXT, XmlNodeType.CDATA),
  
positive.code: }
  
  void assertReaderInvariants(String input, XmlNode node) {
    final includedTypes = new Set.from([
      XmlNodeType.ELEMENT,
      XmlNodeType.TEXT,
      XmlNodeType.CDATA,
      XmlNodeType.PROCESSING,
    ]);
    final nodes = node.descendants
        .where((node) => includedTypes.contains(node.nodeType))
        .toList(growable: true);
    final stack = <XmlName>[];
    final reader = new XmlReader(
      onStartElement: (name, attributes) {
        expect(nodes, isNotEmpty);
        XmlNode node = nodes.removeAt(0);
        expect(node.nodeType, XmlNodeType.ELEMENT,
            reason: 'Node type should be an ELEMENT.');
  
negative.code:       expect(text, node.text, reason: 'Text data should match.');
      },
      onProcessingInstruction: (target, text) {
        expect(state, 1, reason: 'Reader not started');
        expect(nodes, isNotEmpty, reason: 'Missing element in node list.');
        XmlNode node = nodes.removeAt(0);
        expect(node.nodeType, XmlNodeType.PROCESSING,
  