From b17551b739be0f17d1e2d2c8197939107e40a66d Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 20 Jun 2024 15:01:10 +0200 Subject: [PATCH] Allow lists --- .../lib/src/data_classes/extensions.dart | 5 +- .../lib/src/proto/usages_read.pbjson.dart | 2 +- .../lib/src/proto/usages_shared.pb.dart | 230 ++++++++++++++---- .../lib/src/proto/usages_shared.pbjson.dart | 107 ++++++-- .../lib/src/proto/usages_shared.proto | 24 +- pkgs/record_use/test/storage_test.dart | 3 +- pkgs/record_use/test/testdata/data.binpb | Bin 510 -> 612 bytes pkgs/record_use/test/testdata/data.dart | 15 ++ .../test/testdata/{data.txtpb => data.json} | 66 ++++- pkgs/record_use/test/usage_test.dart | 11 +- 10 files changed, 386 insertions(+), 77 deletions(-) rename pkgs/record_use/test/testdata/{data.txtpb => data.json} (59%) diff --git a/pkgs/record_use/lib/src/data_classes/extensions.dart b/pkgs/record_use/lib/src/data_classes/extensions.dart index 7c625bf9..0e9d33f3 100644 --- a/pkgs/record_use/lib/src/data_classes/extensions.dart +++ b/pkgs/record_use/lib/src/data_classes/extensions.dart @@ -133,10 +133,13 @@ extension IdentifierStorageExt on pb_storage.Identifier { extension FieldValueExt on pb_shared.FieldValue { Object toObject() => switch (whichValue()) { + pb_shared.FieldValue_Value.map => + map.value.map((key, value) => MapEntry(key, value.toObject())), + pb_shared.FieldValue_Value.list => list.value.map((e) => e.toObject()), pb_shared.FieldValue_Value.intValue => intValue, pb_shared.FieldValue_Value.doubleValue => doubleValue, pb_shared.FieldValue_Value.boolValue => boolValue, pb_shared.FieldValue_Value.stringValue => stringValue, - pb_shared.FieldValue_Value.notSet => throw ArgumentError(), + pb_shared.FieldValue_Value.notSet => throw UnimplementedError(), }; } diff --git a/pkgs/record_use/lib/src/proto/usages_read.pbjson.dart b/pkgs/record_use/lib/src/proto/usages_read.pbjson.dart index 82b4dc57..d6de7a6c 100644 --- a/pkgs/record_use/lib/src/proto/usages_read.pbjson.dart +++ b/pkgs/record_use/lib/src/proto/usages_read.pbjson.dart @@ -4,7 +4,7 @@ // // @dart = 2.12 -// ignore_for_file: annotate_overrides, camel_case_types, comment_references, lines_longer_than_80_chars +// ignore_for_file: annotate_overrides, camel_case_types, comment_references // ignore_for_file: constant_identifier_names, library_prefixes // ignore_for_file: non_constant_identifier_names, prefer_final_fields // ignore_for_file: unnecessary_import, unnecessary_this, unused_import diff --git a/pkgs/record_use/lib/src/proto/usages_shared.pb.dart b/pkgs/record_use/lib/src/proto/usages_shared.pb.dart index ea404c21..f535a362 100644 --- a/pkgs/record_use/lib/src/proto/usages_shared.pb.dart +++ b/pkgs/record_use/lib/src/proto/usages_shared.pb.dart @@ -140,8 +140,6 @@ class Fields extends $pb.GeneratedMessage { $core.List get fields => $_getList(0); } -enum Arguments_Kind { constArguments, nonConstArguments, notSet } - class Arguments extends $pb.GeneratedMessage { factory Arguments({ ConstArguments? constArguments, @@ -164,16 +162,10 @@ class Arguments extends $pb.GeneratedMessage { [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - static const $core.Map<$core.int, Arguments_Kind> _Arguments_KindByTag = { - 1: Arguments_Kind.constArguments, - 2: Arguments_Kind.nonConstArguments, - 0: Arguments_Kind.notSet - }; static final $pb.BuilderInfo _i = $pb.BuilderInfo( _omitMessageNames ? '' : 'Arguments', package: const $pb.PackageName(_omitMessageNames ? '' : 'usages_shared'), createEmptyInstance: create) - ..oo(0, [1, 2]) ..aOM(1, _omitFieldNames ? '' : 'constArguments', subBuilder: ConstArguments.create) ..aOM(2, _omitFieldNames ? '' : 'nonConstArguments', @@ -201,9 +193,6 @@ class Arguments extends $pb.GeneratedMessage { _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Arguments? _defaultInstance; - Arguments_Kind whichKind() => _Arguments_KindByTag[$_whichOneof(0)]!; - void clearKind() => clearField($_whichOneof(0)); - @$pb.TagNumber(1) ConstArguments get constArguments => $_getN(0); @$pb.TagNumber(1) @@ -461,16 +450,32 @@ class Field extends $pb.GeneratedMessage { FieldValue ensureValue() => $_ensure(2); } -enum FieldValue_Value { intValue, doubleValue, boolValue, stringValue, notSet } +enum FieldValue_Value { + map, + list, + intValue, + doubleValue, + boolValue, + stringValue, + notSet +} class FieldValue extends $pb.GeneratedMessage { factory FieldValue({ + StringMapValue? map, + ListValue? list, $core.int? intValue, $core.double? doubleValue, $core.bool? boolValue, $core.String? stringValue, }) { final $result = create(); + if (map != null) { + $result.map = map; + } + if (list != null) { + $result.list = list; + } if (intValue != null) { $result.intValue = intValue; } @@ -494,22 +499,28 @@ class FieldValue extends $pb.GeneratedMessage { create()..mergeFromJson(i, r); static const $core.Map<$core.int, FieldValue_Value> _FieldValue_ValueByTag = { - 1: FieldValue_Value.intValue, - 2: FieldValue_Value.doubleValue, - 3: FieldValue_Value.boolValue, - 4: FieldValue_Value.stringValue, + 1: FieldValue_Value.map, + 2: FieldValue_Value.list, + 3: FieldValue_Value.intValue, + 4: FieldValue_Value.doubleValue, + 5: FieldValue_Value.boolValue, + 6: FieldValue_Value.stringValue, 0: FieldValue_Value.notSet }; static final $pb.BuilderInfo _i = $pb.BuilderInfo( _omitMessageNames ? '' : 'FieldValue', package: const $pb.PackageName(_omitMessageNames ? '' : 'usages_shared'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 4]) - ..a<$core.int>(1, _omitFieldNames ? '' : 'intValue', $pb.PbFieldType.O3) + ..oo(0, [1, 2, 3, 4, 5, 6]) + ..aOM(1, _omitFieldNames ? '' : 'map', + subBuilder: StringMapValue.create) + ..aOM(2, _omitFieldNames ? '' : 'list', + subBuilder: ListValue.create) + ..a<$core.int>(3, _omitFieldNames ? '' : 'intValue', $pb.PbFieldType.O3) ..a<$core.double>( - 2, _omitFieldNames ? '' : 'doubleValue', $pb.PbFieldType.OD) - ..aOB(3, _omitFieldNames ? '' : 'boolValue') - ..aOS(4, _omitFieldNames ? '' : 'stringValue') + 4, _omitFieldNames ? '' : 'doubleValue', $pb.PbFieldType.OD) + ..aOB(5, _omitFieldNames ? '' : 'boolValue') + ..aOS(6, _omitFieldNames ? '' : 'stringValue') ..hasRequiredFields = false; @$core.Deprecated('Using this can add significant overhead to your binary. ' @@ -537,52 +548,189 @@ class FieldValue extends $pb.GeneratedMessage { void clearValue() => clearField($_whichOneof(0)); @$pb.TagNumber(1) - $core.int get intValue => $_getIZ(0); + StringMapValue get map => $_getN(0); @$pb.TagNumber(1) - set intValue($core.int v) { - $_setSignedInt32(0, v); + set map(StringMapValue v) { + setField(1, v); } @$pb.TagNumber(1) - $core.bool hasIntValue() => $_has(0); + $core.bool hasMap() => $_has(0); + @$pb.TagNumber(1) + void clearMap() => clearField(1); @$pb.TagNumber(1) - void clearIntValue() => clearField(1); + StringMapValue ensureMap() => $_ensure(0); @$pb.TagNumber(2) - $core.double get doubleValue => $_getN(1); + ListValue get list => $_getN(1); @$pb.TagNumber(2) - set doubleValue($core.double v) { - $_setDouble(1, v); + set list(ListValue v) { + setField(2, v); } @$pb.TagNumber(2) - $core.bool hasDoubleValue() => $_has(1); + $core.bool hasList() => $_has(1); + @$pb.TagNumber(2) + void clearList() => clearField(2); @$pb.TagNumber(2) - void clearDoubleValue() => clearField(2); + ListValue ensureList() => $_ensure(1); @$pb.TagNumber(3) - $core.bool get boolValue => $_getBF(2); + $core.int get intValue => $_getIZ(2); @$pb.TagNumber(3) - set boolValue($core.bool v) { - $_setBool(2, v); + set intValue($core.int v) { + $_setSignedInt32(2, v); } @$pb.TagNumber(3) - $core.bool hasBoolValue() => $_has(2); + $core.bool hasIntValue() => $_has(2); @$pb.TagNumber(3) - void clearBoolValue() => clearField(3); + void clearIntValue() => clearField(3); @$pb.TagNumber(4) - $core.String get stringValue => $_getSZ(3); + $core.double get doubleValue => $_getN(3); @$pb.TagNumber(4) - set stringValue($core.String v) { - $_setString(3, v); + set doubleValue($core.double v) { + $_setDouble(3, v); } @$pb.TagNumber(4) - $core.bool hasStringValue() => $_has(3); + $core.bool hasDoubleValue() => $_has(3); @$pb.TagNumber(4) - void clearStringValue() => clearField(4); + void clearDoubleValue() => clearField(4); + + @$pb.TagNumber(5) + $core.bool get boolValue => $_getBF(4); + @$pb.TagNumber(5) + set boolValue($core.bool v) { + $_setBool(4, v); + } + + @$pb.TagNumber(5) + $core.bool hasBoolValue() => $_has(4); + @$pb.TagNumber(5) + void clearBoolValue() => clearField(5); + + @$pb.TagNumber(6) + $core.String get stringValue => $_getSZ(5); + @$pb.TagNumber(6) + set stringValue($core.String v) { + $_setString(5, v); + } + + @$pb.TagNumber(6) + $core.bool hasStringValue() => $_has(5); + @$pb.TagNumber(6) + void clearStringValue() => clearField(6); +} + +class ListValue extends $pb.GeneratedMessage { + factory ListValue({ + $core.Iterable? value, + }) { + final $result = create(); + if (value != null) { + $result.value.addAll(value); + } + return $result; + } + ListValue._() : super(); + factory ListValue.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ListValue.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ListValue', + package: const $pb.PackageName(_omitMessageNames ? '' : 'usages_shared'), + createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'value', $pb.PbFieldType.PM, + subBuilder: FieldValue.create) + ..hasRequiredFields = false; + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ListValue clone() => ListValue()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ListValue copyWith(void Function(ListValue) updates) => + super.copyWith((message) => updates(message as ListValue)) as ListValue; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ListValue create() => ListValue._(); + ListValue createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ListValue getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ListValue? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get value => $_getList(0); +} + +class StringMapValue extends $pb.GeneratedMessage { + factory StringMapValue({ + $core.Map<$core.String, FieldValue>? value, + }) { + final $result = create(); + if (value != null) { + $result.value.addAll(value); + } + return $result; + } + StringMapValue._() : super(); + factory StringMapValue.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory StringMapValue.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'StringMapValue', + package: const $pb.PackageName(_omitMessageNames ? '' : 'usages_shared'), + createEmptyInstance: create) + ..m<$core.String, FieldValue>(1, _omitFieldNames ? '' : 'value', + entryClassName: 'StringMapValue.ValueEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.OM, + valueCreator: FieldValue.create, + valueDefaultOrMaker: FieldValue.getDefault, + packageName: const $pb.PackageName('usages_shared')) + ..hasRequiredFields = false; + + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + StringMapValue clone() => StringMapValue()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + StringMapValue copyWith(void Function(StringMapValue) updates) => + super.copyWith((message) => updates(message as StringMapValue)) + as StringMapValue; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static StringMapValue create() => StringMapValue._(); + StringMapValue createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); + @$core.pragma('dart2js:noInline') + static StringMapValue getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static StringMapValue? _defaultInstance; + + @$pb.TagNumber(1) + $core.Map<$core.String, FieldValue> get value => $_getMap(0); } const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); diff --git a/pkgs/record_use/lib/src/proto/usages_shared.pbjson.dart b/pkgs/record_use/lib/src/proto/usages_shared.pbjson.dart index 4b0149e3..e9691b3c 100644 --- a/pkgs/record_use/lib/src/proto/usages_shared.pbjson.dart +++ b/pkgs/record_use/lib/src/proto/usages_shared.pbjson.dart @@ -4,7 +4,7 @@ // // @dart = 2.12 -// ignore_for_file: annotate_overrides, camel_case_types, comment_references, lines_longer_than_80_chars +// ignore_for_file: annotate_overrides, camel_case_types, comment_references // ignore_for_file: constant_identifier_names, library_prefixes // ignore_for_file: non_constant_identifier_names, prefer_final_fields // ignore_for_file: unnecessary_import, unnecessary_this, unused_import @@ -67,7 +67,6 @@ const Arguments$json = { '4': 1, '5': 11, '6': '.usages_shared.ConstArguments', - '9': 0, '10': 'constArguments' }, { @@ -76,21 +75,16 @@ const Arguments$json = { '4': 1, '5': 11, '6': '.usages_shared.NonConstArguments', - '9': 0, '10': 'nonConstArguments' }, ], - '8': [ - {'1': 'kind'}, - ], }; /// Descriptor for `Arguments`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List argumentsDescriptor = $convert.base64Decode( - 'CglBcmd1bWVudHMSSAoPY29uc3RfYXJndW1lbnRzGAEgASgLMh0udXNhZ2VzX3NoYXJlZC5Db2' - '5zdEFyZ3VtZW50c0gAUg5jb25zdEFyZ3VtZW50cxJSChNub25fY29uc3RfYXJndW1lbnRzGAIg' - 'ASgLMiAudXNhZ2VzX3NoYXJlZC5Ob25Db25zdEFyZ3VtZW50c0gAUhFub25Db25zdEFyZ3VtZW' - '50c0IGCgRraW5k'); + 'CglBcmd1bWVudHMSRgoPY29uc3RfYXJndW1lbnRzGAEgASgLMh0udXNhZ2VzX3NoYXJlZC5Db2' + '5zdEFyZ3VtZW50c1IOY29uc3RBcmd1bWVudHMSUAoTbm9uX2NvbnN0X2FyZ3VtZW50cxgCIAEo' + 'CzIgLnVzYWdlc19zaGFyZWQuTm9uQ29uc3RBcmd1bWVudHNSEW5vbkNvbnN0QXJndW1lbnRz'); @$core.Deprecated('Use constArgumentsDescriptor instead') const ConstArguments$json = { @@ -200,10 +194,28 @@ final $typed_data.Uint8List fieldDescriptor = $convert.base64Decode( const FieldValue$json = { '1': 'FieldValue', '2': [ - {'1': 'int_value', '3': 1, '4': 1, '5': 5, '9': 0, '10': 'intValue'}, - {'1': 'double_value', '3': 2, '4': 1, '5': 1, '9': 0, '10': 'doubleValue'}, - {'1': 'bool_value', '3': 3, '4': 1, '5': 8, '9': 0, '10': 'boolValue'}, - {'1': 'string_value', '3': 4, '4': 1, '5': 9, '9': 0, '10': 'stringValue'}, + { + '1': 'map', + '3': 1, + '4': 1, + '5': 11, + '6': '.usages_shared.StringMapValue', + '9': 0, + '10': 'map' + }, + { + '1': 'list', + '3': 2, + '4': 1, + '5': 11, + '6': '.usages_shared.ListValue', + '9': 0, + '10': 'list' + }, + {'1': 'int_value', '3': 3, '4': 1, '5': 5, '9': 0, '10': 'intValue'}, + {'1': 'double_value', '3': 4, '4': 1, '5': 1, '9': 0, '10': 'doubleValue'}, + {'1': 'bool_value', '3': 5, '4': 1, '5': 8, '9': 0, '10': 'boolValue'}, + {'1': 'string_value', '3': 6, '4': 1, '5': 9, '9': 0, '10': 'stringValue'}, ], '8': [ {'1': 'value'}, @@ -212,6 +224,67 @@ const FieldValue$json = { /// Descriptor for `FieldValue`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List fieldValueDescriptor = $convert.base64Decode( - 'CgpGaWVsZFZhbHVlEh0KCWludF92YWx1ZRgBIAEoBUgAUghpbnRWYWx1ZRIjCgxkb3VibGVfdm' - 'FsdWUYAiABKAFIAFILZG91YmxlVmFsdWUSHwoKYm9vbF92YWx1ZRgDIAEoCEgAUglib29sVmFs' - 'dWUSIwoMc3RyaW5nX3ZhbHVlGAQgASgJSABSC3N0cmluZ1ZhbHVlQgcKBXZhbHVl'); + 'CgpGaWVsZFZhbHVlEjEKA21hcBgBIAEoCzIdLnVzYWdlc19zaGFyZWQuU3RyaW5nTWFwVmFsdW' + 'VIAFIDbWFwEi4KBGxpc3QYAiABKAsyGC51c2FnZXNfc2hhcmVkLkxpc3RWYWx1ZUgAUgRsaXN0' + 'Eh0KCWludF92YWx1ZRgDIAEoBUgAUghpbnRWYWx1ZRIjCgxkb3VibGVfdmFsdWUYBCABKAFIAF' + 'ILZG91YmxlVmFsdWUSHwoKYm9vbF92YWx1ZRgFIAEoCEgAUglib29sVmFsdWUSIwoMc3RyaW5n' + 'X3ZhbHVlGAYgASgJSABSC3N0cmluZ1ZhbHVlQgcKBXZhbHVl'); + +@$core.Deprecated('Use listValueDescriptor instead') +const ListValue$json = { + '1': 'ListValue', + '2': [ + { + '1': 'value', + '3': 1, + '4': 3, + '5': 11, + '6': '.usages_shared.FieldValue', + '10': 'value' + }, + ], +}; + +/// Descriptor for `ListValue`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List listValueDescriptor = $convert.base64Decode( + 'CglMaXN0VmFsdWUSLwoFdmFsdWUYASADKAsyGS51c2FnZXNfc2hhcmVkLkZpZWxkVmFsdWVSBX' + 'ZhbHVl'); + +@$core.Deprecated('Use stringMapValueDescriptor instead') +const StringMapValue$json = { + '1': 'StringMapValue', + '2': [ + { + '1': 'value', + '3': 1, + '4': 3, + '5': 11, + '6': '.usages_shared.StringMapValue.ValueEntry', + '10': 'value' + }, + ], + '3': [StringMapValue_ValueEntry$json], +}; + +@$core.Deprecated('Use stringMapValueDescriptor instead') +const StringMapValue_ValueEntry$json = { + '1': 'ValueEntry', + '2': [ + {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + { + '1': 'value', + '3': 2, + '4': 1, + '5': 11, + '6': '.usages_shared.FieldValue', + '10': 'value' + }, + ], + '7': {'7': true}, +}; + +/// Descriptor for `StringMapValue`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List stringMapValueDescriptor = $convert.base64Decode( + 'Cg5TdHJpbmdNYXBWYWx1ZRI+CgV2YWx1ZRgBIAMoCzIoLnVzYWdlc19zaGFyZWQuU3RyaW5nTW' + 'FwVmFsdWUuVmFsdWVFbnRyeVIFdmFsdWUaUwoKVmFsdWVFbnRyeRIQCgNrZXkYASABKAlSA2tl' + 'eRIvCgV2YWx1ZRgCIAEoCzIZLnVzYWdlc19zaGFyZWQuRmllbGRWYWx1ZVIFdmFsdWU6AjgB'); diff --git a/pkgs/record_use/lib/src/proto/usages_shared.proto b/pkgs/record_use/lib/src/proto/usages_shared.proto index 03a44866..c8b3cc33 100644 --- a/pkgs/record_use/lib/src/proto/usages_shared.proto +++ b/pkgs/record_use/lib/src/proto/usages_shared.proto @@ -11,10 +11,8 @@ message Fields { } message Arguments { - oneof kind { - ConstArguments const_arguments = 1; - NonConstArguments non_const_arguments = 2; - } + ConstArguments const_arguments = 1; + NonConstArguments non_const_arguments = 2; } message ConstArguments { @@ -35,9 +33,19 @@ message Field { message FieldValue { oneof value { - int32 int_value = 1; - double double_value = 2; - bool bool_value = 3; - string string_value = 4; + StringMapValue map = 1; + ListValue list = 2; + int32 int_value = 3; + double double_value = 4; + bool bool_value = 5; + string string_value = 6; } } + +message ListValue { + repeated FieldValue value = 1; +} + +message StringMapValue { + map value = 1; +} diff --git a/pkgs/record_use/test/storage_test.dart b/pkgs/record_use/test/storage_test.dart index 630e5d37..4a3ec099 100644 --- a/pkgs/record_use/test/storage_test.dart +++ b/pkgs/record_use/test/storage_test.dart @@ -12,7 +12,8 @@ import 'testdata/data.dart'; void main() { test('Buffer->Object->Buffer', () { - // File('test/testdata/data.txtpb') + // Uncomment to reset test files + // File('test/testdata/data.json') // .writeAsStringSync(recordedUses.toDebugJson()); // File('test/testdata/data.binpb').writeAsBytesSync(recordedUses.toBuffer()); final recordedUsesPb = File('test/testdata/data.binpb').readAsBytesSync(); diff --git a/pkgs/record_use/test/testdata/data.binpb b/pkgs/record_use/test/testdata/data.binpb index 8dfb96ba32da270bb021f56f0dd25f194833dbf1..f7779a6ad15b0969cbf2dc57581e240838058497 100644 GIT binary patch delta 209 zcmeyz{Dfsg1S8X9#>tV4GWA9rIhjfE!5)r=Tx=YSLQEPAK$=O2NrF*Gh>JBRwJ5(* zh|`EYD>W}WGp|@kn2Rl~C^aPoESQ^Glw4X=Db&aa(ks9xVIahkua{LURmhdZ#mB)Q z#D!uy$W#U{K@JunUM_AfPA=x`)JkihSTa_d6uHH delta 106 zcmaFD@{f5#1S4bJ%%u2W4@W~THV#H1CJ6>0%_PJGWD9Yz=A;(oR|;_| zv1g^`WoPCU3kh?vr4^;7q<{r;Q;U*Iiz{0: 'lib_SHA1', 1: false, 2: 1}, ); - expect(arguments[1].named, isEmpty); - expect(arguments[1].positional, isEmpty); + expect(arguments[1].named, { + 'leroy': 'jenkins', + 'albert': ['camus', 'einstein'] + }); + expect(arguments[1].positional, { + 0: 'lib_SHA1', + 2: 0, + 4: {'key': 99} + }); }); test('API instances', () { final recordedUsesPb = File('test/testdata/data.binpb').readAsBytesSync();