Files
SpotiFLAC-Mobile/test/native_palette_worker_test.dart
T
zarzet d693e1a479 perf(theme): extract cover palettes with native quantization
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.
2026-10-06 23:27:38 +07:00

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']}',
);
}
});
}