feat: 完善听力口语辅助状态记录、练习分块与复习抽查间隔机制
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:kouyu_english/core/courses/courses.dart';
|
||||
import 'package:kouyu_english/core/courses/course_pack.dart';
|
||||
|
||||
import '../tool/courses/course_validator.dart';
|
||||
|
||||
@@ -56,4 +58,16 @@ void main() {
|
||||
).validate();
|
||||
expect(report.errors.map((issue) => '$issue'), isEmpty);
|
||||
});
|
||||
|
||||
test('the course parser keeps item links and extra model sentences', () {
|
||||
final unit =
|
||||
jsonDecode(File('assets/courses/A1/A1-U01.json').readAsStringSync())
|
||||
as Map<String, dynamic>;
|
||||
final segment = PackSegment.fromJson(
|
||||
(unit['segments'] as List).first as Map<String, dynamic>,
|
||||
);
|
||||
expect(segment.speakingItemIds, ['A1-U01-P01', 'A1-U01-P04']);
|
||||
expect(segment.speakingExamples, isNotEmpty);
|
||||
expect(segment.speakingChunks.join(' '), segment.speakingText);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user