From 1a1b3481aab3b82dcf283e970003b79da6e500f9 Mon Sep 17 00:00:00 2001 From: Tim Shedor Date: Mon, 27 May 2024 12:13:33 -0700 Subject: [PATCH] fix tests --- .../lib/src/offline_first_sqlite_generators.dart | 6 +++--- .../test/offline_first_generator_test.dart | 2 +- .../brick_sqlite_generators/lib/src/sqlite_serialize.dart | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/brick_offline_first_build/lib/src/offline_first_sqlite_generators.dart b/packages/brick_offline_first_build/lib/src/offline_first_sqlite_generators.dart index 690cb2c2..a3b7528c 100644 --- a/packages/brick_offline_first_build/lib/src/offline_first_sqlite_generators.dart +++ b/packages/brick_offline_first_build/lib/src/offline_first_sqlite_generators.dart @@ -52,12 +52,12 @@ class OfflineFirstSqliteSerialize extends SqliteSerialize { } @override - String uniqueValueForField(annotatedName, {required checker}) { + String uniqueValueForField(fieldName, {required checker}) { if ((checker as OfflineFirstChecker).hasSerdes) { - return '$annotatedName.toSqlite()'; + return '$fieldName.toSqlite()'; } - return super.uniqueValueForField(annotatedName, checker: checker); + return super.uniqueValueForField(fieldName, checker: checker); } } diff --git a/packages/brick_offline_first_build/test/offline_first_generator_test.dart b/packages/brick_offline_first_build/test/offline_first_generator_test.dart index ad250650..2980320f 100644 --- a/packages/brick_offline_first_build/test/offline_first_generator_test.dart +++ b/packages/brick_offline_first_build/test/offline_first_generator_test.dart @@ -89,7 +89,7 @@ void main() { test('OfflineFirstSerdesWithTypeArgument', () async { await generateAdapterExpectation( - 'offlne_first_serdes_with_type_argument', + 'offline_first_serdes_with_type_argument', offlineFirstSerdesWithTypeArgument.output, ); }); diff --git a/packages/brick_sqlite_generators/lib/src/sqlite_serialize.dart b/packages/brick_sqlite_generators/lib/src/sqlite_serialize.dart index a4323b59..57fcd0ec 100644 --- a/packages/brick_sqlite_generators/lib/src/sqlite_serialize.dart +++ b/packages/brick_sqlite_generators/lib/src/sqlite_serialize.dart @@ -49,7 +49,7 @@ class SqliteSerialize<_Model extends SqliteModel> extends SqliteSerdesGenerator< type: $columnInsertionType, )'''); if (annotation.unique) { - final value = uniqueValueForField(annotation.name, checker: checker); + final value = uniqueValueForField(field.name, checker: checker); uniqueFields[value] = columnName; } } @@ -345,8 +345,8 @@ class SqliteSerialize<_Model extends SqliteModel> extends SqliteSerdesGenerator< /// confuse maintenance. A string or int or double is more than sufficient to determine /// a row's uniqueness. @protected - String uniqueValueForField(String? annotatedName, {required SharedChecker checker}) { - return annotatedName ?? ''; + String uniqueValueForField(String? fieldName, {required SharedChecker checker}) { + return fieldName ?? ''; } }