mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-21 15:02:21 +02:00
Handle feature and featured separators across display, Android finalization and Rust tag writing. Split conjunction credits only when separate artist IDs confirm them, and offer a picker for multi-artist navigation.
42 lines
1.4 KiB
Dart
42 lines
1.4 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:spotiflac_android/utils/artist_utils.dart';
|
|
|
|
void main() {
|
|
test('featured variants and confirmed conjunction credits are clickable', () {
|
|
expect(splitArtistNames('One featured Two'), ['One', 'Two']);
|
|
expect(splitArtistNames('One feature Two'), ['One', 'Two']);
|
|
expect(primaryArtistTagValue('One featured Two'), 'One');
|
|
expect(primaryArtistTagValue('One feature Two'), 'One');
|
|
expect(splitArtistNames('One and Two', creditedArtistCount: 2), [
|
|
'One',
|
|
'Two',
|
|
]);
|
|
expect(splitArtistNames('Florence and the Machine'), [
|
|
'Florence and the Machine',
|
|
]);
|
|
expect(
|
|
splitArtistNames('Florence and the Machine', creditedArtistCount: 1),
|
|
['Florence and the Machine'],
|
|
);
|
|
});
|
|
test('primary artist prefers the first album artist', () {
|
|
expect(
|
|
primaryArtistName(
|
|
'Track Artist, Guest Artist',
|
|
albumArtist: 'Album Artist & Collaborator',
|
|
),
|
|
'Album Artist',
|
|
);
|
|
});
|
|
|
|
test('primary artist handles provider separator variants', () {
|
|
expect(primaryArtistName('One; Two & Three'), 'One');
|
|
expect(primaryArtistName('One feat. Two'), 'One');
|
|
expect(primaryArtistName('AC/DC'), 'AC/DC');
|
|
expect(
|
|
primaryArtistName('Actual Artist, Guest', albumArtist: 'Various Artists'),
|
|
'Actual Artist',
|
|
);
|
|
});
|
|
}
|