Files
SpotiFLAC-Mobile/test/native_library_contract_test.dart
T
zarzet d1de833184 perf(library): index scans and snapshots with native SQLite workers
Move full and incremental ingestion, source snapshots, path keys, and download exclusion to native transactions. Preserve schema 17, FTS, WAL coordination, cancellation, and Android SAF timestamp backfill.
2026-10-06 23:29:33 +07:00

40 lines
1.1 KiB
Dart

import 'dart:convert';
import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'package:spotiflac_android/services/library_row_mapper.dart';
import 'package:spotiflac_android/utils/path_match_keys.dart';
void main() {
test(
'native library fixtures preserve production Dart row and path codecs',
() {
final fixture =
jsonDecode(
File(
'test/fixtures/native_library_contract.json',
).readAsStringSync(),
)
as Map<String, dynamic>;
for (final entry in fixture['rows'] as List) {
final value = entry as Map<String, dynamic>;
expect(
LibraryRowMapper.encode(
Map<String, dynamic>.from(value['input'] as Map),
sourceId: 'source',
),
value['expected'],
);
}
for (final entry in fixture['paths'] as List) {
final value = entry as Map<String, dynamic>;
expect(
buildPathMatchKeys(value['input'] as String).toList()..sort(),
value['expected'],
reason: value['input'] as String,
);
}
},
);
}