anchor.diff:          0x18,
           0x18,
           0x19
  -      ];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, [
  -        1,
  -        2,
  -        3,
  -        4,
  -        5,
  -        6,
  -        7,
  -        8,
  -        9,
  -        10,
  -        11,
  -        12,
  -        13,
  -        14,
  -        15,
  -        16,
  -        17,
  -        18,
  -        19,
  -        20,
  -        21,
  -        22,
  -        23,
  -        24,
  -        25
  -      ]);
  -      expect(listener.lastSize, 25);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], [
  -        1,
  -        2,
  -        3,
  -        4,
  -        5,
  -        6,
  -        7,
  -        8,
  -        9,
  -        10,
  -        11,
  -        12,
  -        13,
  -        14,
  -        15,
  -        16,
  -        17,
  -        18,
  -        19,
  -        20,
  -        21,
  -        22,
  -        23,
  -        24,
  -        25
  -      ]);
  +      ]);
  +      expect(decoded is CborList, true);
  +      if (decoded is CborList) {
  +        for (var i = 0; i < 25; i++) {
  +          expect(decoded[i], CborSmallInt(i + 1));
  +        }
  +      }
       });
   
       test('Nested array', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x83, 0x01, 0x82, 0x02, 0x03, 0x82, 0x04, 0x05];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, [1, 2, 3, 4, 5]);
  -      expect(listener.lastSize, 2);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], [
  -        1,
  -        [2, 3],
  -        [4, 5]
  +      final decoded =
  +          cbor.decode([0x83, 0x01, 0x82, 0x02, 0x03, 0x82, 0x04, 0x05]);
  +      expect(decoded, [
  +        CborSmallInt(1),
  +        [CborSmallInt(2), CborSmallInt(3)],
  +        [CborSmallInt(4), CborSmallInt(5)],
         ]);
       });
   
       test('Empty Map', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0xa0];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, []);
  -      expect(listener.lastSize, 0);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], {});
  +      final decoded = cbor.decode([0xa0]);
  +      expect(decoded, {});
       });
   
       test('{1: 2, 3: 4}', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0xa2, 0x01, 0x02, 0x03, 0x04];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, [1, 2, 3, 4]);
  -      expect(listener.lastSize, 2);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], {1: 2, 3: 4});
  +      final decoded = cbor.decode([0xa2, 0x01, 0x02, 0x03, 0x04]);
  +      expect(decoded, {
  +        CborSmallInt(1): CborSmallInt(2),
  +        CborSmallInt(3): CborSmallInt(4),
  +      });
       });
   
       test('{"a": 1, "b": [2, 3]}', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0xa2, 0x61, 0x61, 0x01, 0x61, 0x62, 0x82, 0x02, 0x03];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['a', 1, 'b', 2, 3]);
  -      expect(listener.lastSize, 2);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], {
  -        'a': 1,
  -        'b': [2, 3]
  +      final decoded =
  +          cbor.decode([0xa2, 0x61, 0x61, 0x01, 0x61, 0x62, 0x82, 0x02, 0x03]);
  +      expect(decoded, {
  +        CborString('a'): CborSmallInt(1),
  +        CborString('b'): [CborSmallInt(2), CborSmallInt(3)],
         });
       });
   
       test('["a", {"b": "c"}]', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [0x82, 0x61, 0x61, 0xa1, 0x61, 0x62, 0x61, 0x63];
  -      final buffer = typed.Uint8Buffer();
  -      buffer.addAll(values);
  -      output.putBytes(buffer);
  -      final input = cbor.Input(output.getData());
  -      final decoder = cbor.Decoder.withListener(input, listener);
  -      decoder.run();
  -      expect(listener.lastValue, ['a', 'b', 'c']);
  -      expect(listener.lastSize, 1);
  -      decoder.listener = slistener;
  -      input.reset();
  -      slistener.itemStack.clear();
  -      decoder.run();
  -      final decodeStack = cbor.DecodeStack();
  -      decodeStack.build(slistener.itemStack);
  -      final slist = decodeStack.walk();
  -      expect(slist, isNotNull);
  -      expect(slist!.length, 1);
  -      expect(slist[0], [
  -        'a',
  -        {'b': 'c'}
  +      final decoded =
  +          cbor.decode([0x82, 0x61, 0x61, 0xa1, 0x61, 0x62, 0x61, 0x63]);
  +      expect(decoded, [
  +        CborString('a'),
  +        {
  +          CborString('b'): CborString('c'),
  +        },
         ]);
       });
   
       test('{"a": "A", "b": "B", "c": "C", "d": "D", "e": "E"}', () {
  -      output.clear();
  -      listener.clear();
  -      final values = [
  +      final decoded = cbor.decode([
           0xa5,
           0x61,
           0x61,
  
positive.code:         0x18,
          0x19,
          0xff
        ];
        final buffer = typed.Uint8Buffer();
        buffer.addAll(values);
        output.putBytes(buffer);
        final input = cbor.Input(output.getData());
        final decoder = cbor.Decoder.withListener(input, listener);
        decoder.run();
        expect(listener.lastValue, [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25
        ]);
        expect(listener.indefiniteStart, isTrue);
        decoder.listener = slistener;
        input.reset();
        slistener.itemStack.clear();
        decoder.run();
        final decodeStack = cbor.DecodeStack();
        decodeStack.build(slistener.itemStack);
        final slist = decodeStack.walk();
        expect(slist, isNotNull);
        expect(slist!.length, 1);
        expect(slist[0], [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25
        ]);
      });
  
      test('{_ "a":1, "b": [_ 2,3]}', () {
        output.clear();
        listener.clear();
        final values = [
          0xbf,
          0x61,
          0x61,
          0x01,
          0x61,
          0x62,
          0x9f,
          0x02,
          0x03,
          0xff,
          0xff
        ];
        final buffer = typed.Uint8Buffer();
        buffer.addAll(values);
        output.putBytes(buffer);
        final input = cbor.Input(output.getData());
        final decoder = cbor.Decoder.withListener(input, listener);
        decoder.run();
        expect(listener.lastValue, ['a', 1, 'b', 2, 3]);
        expect(listener.indefiniteStart, isTrue);
        decoder.listener = slistener;
        input.reset();
        slistener.itemStack.clear();
        decoder.run();
        final decodeStack = cbor.DecodeStack();
        decodeStack.build(slistener.itemStack);
        final slist = decodeStack.walk();
        expect(slist, isNotNull);
        expect(slist!.length, 1);
        expect(slist[0], {
          'a': 1,
          'b': [2, 3]
        });
      });
  
      test('["a", {_ "b": "c"}]', () {
        output.clear();
        listener.clear();
        final values = [0x82, 0x61, 0x61, 0xbf, 0x61, 0x62, 0x61, 0x63, 0xff];
        final buffer = typed.Uint8Buffer();
        buffer.addAll(values);
        output.putBytes(buffer);
        final input = cbor.Input(output.getData());
        final decoder = cbor.Decoder.withListener(input, listener);
        decoder.run();
        expect(listener.lastValue, ['a', 'b', 'c']);
        expect(listener.indefiniteStart, isTrue);
        decoder.listener = slistener;
        input.reset();
        slistener.itemStack.clear();
        decoder.run();
        final decodeStack = cbor.DecodeStack();
        decodeStack.build(slistener.itemStack);
        final slist = decodeStack.walk();
        expect(slist, isNotNull);
        expect(slist!.length, 1);
        expect(slist[0], [
          'a',
          {'b': 'c'}
        ]);
      });
  
      test('{_ "Fun": true, "Amt": -2}', () {
        output.clear();
        listener.clear();
        final values = [
          0xbf,
          0x63,
          0x46,
  
negative.code:         0x30,
          0x30,
          0x5a
        ]);
        expect(decoded, CborDateTimeString.fromString('2013-03-21T20:04:00Z'));
        expect((decoded as CborDateTime).toDateTime(),
            DateTime.parse('2013-03-21T20:04:00Z'));
      });
  
      test('Tag (1) Int', () {
        final decoded = cbor.decode([0xc1, 0x1a, 0x51, 0x4b, 0x67, 0xb0]);
        expect(decoded, CborDateTimeInt.fromSecondsSinceEpoch(1363896240));
      });
  
      test('Tag (1) Float', () {
        final decoded = cbor
            .decode([0xc1, 0xfb, 0x41, 0xd4, 0x52, 0xd9, 0xec, 0x20, 0x00, 0x00]);
        expect(decoded, CborDateTimeFloat.fromSecondsSinceEpoch(1363896240.5));
      });
  
      test('Tag (23) multiple', () {
        final decoded = cbor.decode([0xd7, 0x44, 0x01, 0x02, 0x03, 0x04]);
        expect(decoded, CborBytes([1, 2, 3, 4]));
        expect(decoded.hints, [CborHint.expectedConversionToBase16]);
      });
  
      test('Tag (24) multiple', () {
        final decoded =
            cbor.decode([0xd8, 0x18, 0x45, 0x64, 0x49, 0x45, 0x54, 0x46]);
        expect(decoded, CborBytes([100, 73, 69, 84, 70]));
        expect(decoded.hints, [CborHint.encodedCborData]);
      });
  
      test('Tag (32) URI', () {
        final decoded = cbor.decode([
          0xd8,
          0x20,
          0x76,
  