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: test/mock_util.dart

Issue 2612233003: Always serialize 64-bit integers as strings in JSON. (Closed)
Patch Set: Add test for JSON-coding of int64s Created 3 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 | « test/map_mixin_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mock_util.dart
diff --git a/test/mock_util.dart b/test/mock_util.dart
index a5ac749f966db38e655809c5b7ff5831fd7f40ea..a0a36d8d25261803fd7eee66b6e8f72ebb1b8f39 100644
--- a/test/mock_util.dart
+++ b/test/mock_util.dart
@@ -4,6 +4,7 @@
library mock_util;
+import 'package:fixnum/fixnum.dart' show Int64;
import 'package:protobuf/protobuf.dart'
show GeneratedMessage, BuilderInfo, CreateBuilderFunc, PbFieldType;
@@ -12,7 +13,8 @@ BuilderInfo mockInfo(String className, CreateBuilderFunc create) {
..a(1, "val", PbFieldType.O3, 42)
..a(2, "str", PbFieldType.OS)
..a(3, "child", PbFieldType.OM, create, create)
- ..p(4, "int32s", PbFieldType.P3);
+ ..p(4, "int32s", PbFieldType.P3)
+ ..a(5, "int64", PbFieldType.O6);
}
/// A minimal protobuf implementation for testing.
@@ -31,6 +33,9 @@ abstract class MockMessage extends GeneratedMessage {
List<int> get int32s => $_get(3, 4, null);
+ Int64 get int64 => $_get(4, 5, 0);
+ set int64(x) => setField(5, x);
+
clone() {
CreateBuilderFunc create = info_.byName["child"].subBuilder;
return create()..mergeFromMessage(this);
« no previous file with comments | « test/map_mixin_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698