added categories, import export, settings
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:receipity/utils/fuzzy.dart';
|
||||
|
||||
void main() {
|
||||
test('matches substrings and character subsequences', () {
|
||||
expect(fuzzyMatch('melk', 'JUMBO BIO VOLLE MELK'), isTrue);
|
||||
expect(fuzzyMatch('jb melk', 'JUMBO BIO VOLLE MELK'), isTrue);
|
||||
expect(fuzzyMatch('aard', 'AARDBEIEN'), isTrue);
|
||||
expect(fuzzyMatch('xyz', 'AARDBEIEN'), isFalse);
|
||||
});
|
||||
|
||||
test('ranks closer matches higher', () {
|
||||
expect(fuzzyScore('melk', 'MELK')! > fuzzyScore('melk', 'JUMBO BIO VOLLE MELK')!, isTrue);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user