m3_lightmeter/test/utils/exif_utils_test.dart
2025-02-17 21:03:09 +01:00

27 lines
732 B
Dart

import 'dart:io';
import 'package:exif/exif.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:lightmeter/utils/exif_utils.dart';
void main() {
group('evFromTags', () {
test(
'camera_stub_image.jpg',
() async {
final bytes = File('assets/camera_stub_image.jpg').readAsBytesSync();
final tags = await readExifFromBytes(bytes);
expectLater(evFromTags(tags), completion(8.25230310752341));
},
);
test(
'no EXIF',
() async {
final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync();
final tags = await readExifFromBytes(bytes);
expectLater(evFromTags(tags), throwsArgumentError);
},
);
});
}