63 lines
1.9 KiB
Dart
63 lines
1.9 KiB
Dart
import 'package:jadb/search.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
import 'setup_database_connection.dart';
|
|
|
|
void main() {
|
|
test('Search a word - english - auto', () async {
|
|
final connection = await setupDatabaseConnection();
|
|
final result = await connection.jadbSearchWord('kana');
|
|
expect(result, isNotNull);
|
|
});
|
|
|
|
test('Get word search count - english - auto', () async {
|
|
final connection = await setupDatabaseConnection();
|
|
final result = await connection.jadbSearchWordCount('kana');
|
|
expect(result, isNotNull);
|
|
});
|
|
|
|
test('Search a word - japanese kana - auto', () async {
|
|
final connection = await setupDatabaseConnection();
|
|
final result = await connection.jadbSearchWord('かな');
|
|
expect(result, isNotNull);
|
|
});
|
|
|
|
test('Get word search count - japanese kana - auto', () async {
|
|
final connection = await setupDatabaseConnection();
|
|
final result = await connection.jadbSearchWordCount('かな');
|
|
expect(result, isNotNull);
|
|
});
|
|
|
|
test('Search a word - japanese kanji - auto', () async {
|
|
final connection = await setupDatabaseConnection();
|
|
final result = await connection.jadbSearchWord('仮名');
|
|
expect(result, isNotNull);
|
|
});
|
|
|
|
test('Get word search count - japanese kanji - auto', () async {
|
|
final connection = await setupDatabaseConnection();
|
|
final result = await connection.jadbSearchWordCount('仮名');
|
|
expect(result, isNotNull);
|
|
});
|
|
|
|
test('Get a word by id', () async {
|
|
final connection = await setupDatabaseConnection();
|
|
final result = await connection.jadbGetWordById(1577090);
|
|
expect(result, isNotNull);
|
|
});
|
|
|
|
test(
|
|
'Serialize all words',
|
|
() async {
|
|
final connection = await setupDatabaseConnection();
|
|
|
|
// Test serializing all words
|
|
for (final letter in 'aiueoksthnmyrw'.split('')) {
|
|
await connection.jadbSearchWord(letter);
|
|
}
|
|
},
|
|
timeout: Timeout.factor(100),
|
|
skip: 'Very slow test',
|
|
);
|
|
}
|