24 lines
740 B
Dart
24 lines
740 B
Dart
// Author: fruit.com.cn
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
test('should_keep_haptic_calls_inside_platform_wrapper', () {
|
|
final violations = <String>[];
|
|
for (final entity in Directory('lib').listSync(recursive: true)) {
|
|
if (entity is! File || !entity.path.endsWith('.dart')) continue;
|
|
if (entity.path.endsWith('lib/core/platform/haptics.dart')) continue;
|
|
final lines = entity.readAsLinesSync();
|
|
for (var index = 0; index < lines.length; index++) {
|
|
if (lines[index].contains('HapticFeedback.')) {
|
|
violations.add('${entity.path}:${index + 1}');
|
|
}
|
|
}
|
|
}
|
|
|
|
expect(violations, isEmpty, reason: violations.join('\n'));
|
|
});
|
|
}
|