mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-20 00:32:15 +02:00
fix(lyrics): align usability checks with shared fixtures
Trim after removing inline timestamps before matching speaker prefixes in Dart. Run one 21-case usability corpus through Dart, Go, and Kotlin tests. Document the shared fixture and trigger Dart and Go CI when its resources change.
This commit is contained in:
@@ -1,7 +1,27 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:spotiflac_android/utils/lyrics_metadata_helper.dart';
|
||||
|
||||
void main() {
|
||||
group('shared lyric usability cases', () {
|
||||
final cases = File(
|
||||
'android/app/src/test/resources/lyrics_usability_cases.tsv',
|
||||
).readAsLinesSync();
|
||||
for (final line in cases) {
|
||||
if (line.isEmpty || line.startsWith('#')) continue;
|
||||
final fields = line.split('\t');
|
||||
test(fields.first, () {
|
||||
expect(fields, hasLength(3));
|
||||
final lyrics = fields[2]
|
||||
.replaceAll(r'\n', '\n')
|
||||
.replaceAll(r'\r', '\r')
|
||||
.replaceAll(r'\t', '\t');
|
||||
expect(hasUsableLyricsContent(lyrics), fields[1] == 'true');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
group('lyrics display normalization', () {
|
||||
test('rejects metadata-only embedded LRC', () {
|
||||
const raw = '''
|
||||
|
||||
Reference in New Issue
Block a user