chore: Move the drift_offline_first to legacy in favor of Serverpod implementation (#32)

This commit is contained in:
Marcelo Mendonça Soares 2026-04-05 23:20:21 -03:00 • committed by Marcelo Soares
commit cbc472523b
No known key found for this signature in database
GPG key ID: CB2F09CE66E99EAD

View file

@ -0,0 +1,27 @@
import 'package:drift_offline_sync/drift_offline_sync.dart';
import 'package:test/test.dart';
const _isoTime = '2001-09-09T01:46:40.000Z';
final _dateTime = DateTime.parse(_isoTime);
void main() {
test('Given an HLC and the HlcConverter '
'when converting to the database format '
'then it returns string with padded unix timestamp.', () {
final hlc = Hlc(_dateTime, 0x17, 'abc');
expect(
hlcConverter.toSql(hlc),
'${_dateTime.millisecondsSinceEpoch.toString().padLeft(15, '0')}-0017-abc',
);
});
test('Given an HLC and the HlcConverter '
'when converting from the database format '
'then it returns the equivalent HLC.', () {
final hlc = Hlc(_dateTime, 0x17, 'abc');
final databaseHlc = hlcConverter.toSql(hlc);
expect(hlcConverter.fromSql(databaseHlc), hlc);
});
}