Index: pkg/analyzer/test/src/summary/flat_buffers_test.dart |
diff --git a/pkg/analyzer/test/src/summary/flat_buffers_test.dart b/pkg/analyzer/test/src/summary/flat_buffers_test.dart |
index 46339a20c8826be6b17a3450ce7d2d40482cbbe8..7539e6b6a20a8bdb0297a7aeeb770b8dfe2f9816 100644 |
--- a/pkg/analyzer/test/src/summary/flat_buffers_test.dart |
+++ b/pkg/analyzer/test/src/summary/flat_buffers_test.dart |
@@ -192,6 +192,28 @@ class BuilderTest { |
expect(items, orderedEquals(values)); |
} |
+ void test_writeList_ofBool() { |
Paul Berry
2016/02/29 21:12:32
This test only exercises a List<bool> of length 10
|
+ List<int> trueBits = <int>[0, 3, 30, 60, 90, 99]; |
+ // write |
+ List<int> byteList; |
+ { |
+ Builder builder = new Builder(initialSize: 0); |
+ List<bool> values = new List<bool>.filled(100, false); |
+ for (int bit in trueBits) { |
+ values[bit] = true; |
+ } |
+ Offset offset = builder.writeListBool(values); |
+ byteList = builder.finish(offset); |
+ } |
+ // read and verify |
+ BufferPointer root = new BufferPointer.fromBytes(byteList); |
+ List<bool> items = const BoolListReader().read(root); |
+ expect(items, hasLength(100)); |
+ for (int i = 0; i < items.length; i++) { |
+ expect(items[i], trueBits.contains(i), reason: 'bit $i'); |
+ } |
+ } |
+ |
void test_writeList_ofFloat64() { |
List<double> values = <double>[-1.234567, 3.4E+9, -5.6E-13, 7.8, 12.13]; |
// write |