Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: pkg/analyzer/test/src/summary/flat_buffers_test.dart

Issue 1568343002: Support for writing Int32 lists. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/flat_buffers.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4f46528817993db051d71b26fd4645231188a0a3..d9bc6616b62a46cb3d9921bd2b31f1b5bd4d232a 100644
--- a/pkg/analyzer/test/src/summary/flat_buffers_test.dart
+++ b/pkg/analyzer/test/src/summary/flat_buffers_test.dart
@@ -107,6 +107,20 @@ class BuilderTest {
expect(const Int32Reader().vTableGet(object, 3), 40);
}
+ void test_writeList_ofInt32() {
+ List<int> byteList;
+ {
+ Builder builder = new Builder(initialSize: 0);
+ Offset offset = builder.writeListInt32(<int>[1, 2, 3, 4, 5]);
+ byteList = builder.finish(offset);
+ }
+ // read and verify
+ BufferPointer root = new BufferPointer.fromBytes(byteList);
+ List<int> items = const ListReader<int>(const Int32Reader()).read(root);
+ expect(items, hasLength(5));
+ expect(items, orderedEquals(<int>[1, 2, 3, 4, 5]));
+ }
+
void test_writeList_ofObjects() {
List<int> byteList;
{
@@ -127,7 +141,7 @@ class BuilderTest {
builder.addInt32(1, 200);
object2 = builder.endTable();
}
- // write the line
+ // write the list
Offset offset = builder.writeList([object1, object2]);
byteList = builder.finish(offset);
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/flat_buffers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698