mirror of
https://github.com/h7x4/unofficial_jisho_api_dart.git
synced 2025-09-21 04:55:56 +02:00
Some debugging
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:path/path.dart' as path;
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:unofficial_jisho_api/unofficial_jisho_api.dart';
|
||||
import 'local_function_test_cases.dart' show test_local_functions;
|
||||
import 'package:test/test.dart';
|
||||
|
||||
final jisho = JishoApi();
|
||||
@@ -21,7 +22,7 @@ void runTestCases(List<String> testCaseFiles, String apiFunction) async {
|
||||
switch(apiFunction) {
|
||||
case 'searchForKanji': {
|
||||
final result = await jisho.searchForKanji(testCase['query']);
|
||||
expect(result, testCase['expectedResult']);
|
||||
expect(result, jsonDecode(testCase['expectedResult']));
|
||||
break;
|
||||
}
|
||||
case 'searchForExamples': {
|
||||
@@ -42,6 +43,8 @@ void runTestCases(List<String> testCaseFiles, String apiFunction) async {
|
||||
|
||||
void main() async {
|
||||
|
||||
await test_local_functions();
|
||||
|
||||
await runTestCases(getFilePaths('kanji_test_cases'), 'searchForKanji');
|
||||
|
||||
await runTestCases(getFilePaths('example_test_cases'), 'searchForExamples');
|
||||
|
Reference in New Issue
Block a user