mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-21 15:02:21 +02:00
Port the pinned Material quantizer and Dart RNG compatibility to Rust while keeping Material Score and final color schemes in Dart. Include exact palette fixtures, licenses, and Kotlin worker ABI coverage.
30 lines
891 B
Dart
30 lines
891 B
Dart
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:spotiflac_android/theme/cover_palette.dart';
|
|
|
|
void main() {
|
|
test('native ordered counts retain the pinned Material palette seeds', () {
|
|
final fixtures =
|
|
jsonDecode(
|
|
File(
|
|
'rust_backend/crates/core/src/native_palette/fixtures.json',
|
|
).readAsStringSync(),
|
|
)
|
|
as Map;
|
|
for (final value in fixtures['fixtures'] as List) {
|
|
final fixture = value as Map<String, dynamic>;
|
|
final colors = [
|
|
for (final pair in fixture['colors'] as List)
|
|
[for (final value in pair as List) (value as num).toInt()],
|
|
];
|
|
expect(
|
|
paletteSeedFromColorCounts(colors),
|
|
fixture['seed_argb'],
|
|
reason: '${fixture['kind']} seed ${fixture['seed']}',
|
|
);
|
|
}
|
|
});
|
|
}
|