diff --git a/packages/at_commons/lib/src/verb/syntax.dart b/packages/at_commons/lib/src/verb/syntax.dart index fb87c01a..4dc8d8c6 100644 --- a/packages/at_commons/lib/src/verb/syntax.dart +++ b/packages/at_commons/lib/src/verb/syntax.dart @@ -24,6 +24,7 @@ class VerbSyntax { r'^config:(?:(?<=config:)block:(?add|remove|show)(?:(?<=show)\s?$|(?:(?<=add|remove):(?(?:@[^:@\s]+)( (?:@[^\s@]+))*$))))|(?:(?<=config:)(?set|reset|print):(?.+)$)'; static const stats = r'^stats(?:((?!0)\d+)?(,(\d+))*)?(:(?(?<=:3:|:15:).+))?$'; + @Deprecated('Use syncFrom') static const sync = r'^sync:(?[0-9]+|-1)(:(?.+))?$'; static const syncFrom = r'^sync:from:(?[0-9]+|-1)(:limit:(?\d+))?(:skipDeletesUntil:(?\d+))?(:(?.+))?$'; diff --git a/packages/at_commons/test/sync_verb_builder_test.dart b/packages/at_commons/test/sync_verb_builder_test.dart index 1d7aa518..72f64a4a 100644 --- a/packages/at_commons/test/sync_verb_builder_test.dart +++ b/packages/at_commons/test/sync_verb_builder_test.dart @@ -5,8 +5,8 @@ void main() { test('build sync verb command with defaults values', () { var syncVerbBuilder = SyncVerbBuilder()..commitId = -1; var command = syncVerbBuilder.buildCommand(); - expect(command, 'sync:-1\n'); - var regex = RegExp(VerbSyntax.sync); + expect(command, 'sync:from:-1:limit:10\n'); + var regex = RegExp(VerbSyntax.syncFrom); command = command.replaceAll('\n', ''); assert(regex.hasMatch(command)); }); @@ -16,8 +16,8 @@ void main() { ..regex = '.buzz' ..commitId = -1; var command = syncVerbBuilder.buildCommand(); - expect(command, 'sync:-1:.buzz\n'); - var regex = RegExp(VerbSyntax.sync); + expect(command, 'sync:from:-1:limit:10:.buzz\n'); + var regex = RegExp(VerbSyntax.syncFrom); command = command.replaceAll('\n', ''); assert(regex.hasMatch(command)); }); @@ -27,8 +27,8 @@ void main() { ..commitId = 3 ..regex = '.buzz'; var command = syncVerbBuilder.buildCommand(); - expect(command, 'sync:3:.buzz\n'); - var regex = RegExp(VerbSyntax.sync); + expect(command, 'sync:from:3:limit:10:.buzz\n'); + var regex = RegExp(VerbSyntax.syncFrom); command = command.replaceAll('\n', ''); assert(regex.hasMatch(command)); });