课程内容 - 重写全部 21 个 A1 单元的听读材料,把本单元理解词织进听/读文本, 单元内理解词复现率从约 20% 提升到约 77%(各单元 56–96%)。 - 修正 U01 房间号与机场大巴同为 thirty 的撞车(改为 17/30/40)。 - 校验器容差按级别读取(A1 为 8%),materials 覆盖率、字数、 选项子串等校验全部通过;course_content_test 通过。 黑夜模式 - app_theme 拆分明/暗两套调色板,AppColors 随亮度切换; main 用 theme/darkTheme/themeMode + builder 镜像已解析亮度; 主题偏好持久化到快照;进度页新增“外观主题”切换。 文档 - COURSE-PACK-JSON.md 更新 A1 词池覆盖(840/933)与材料复现约定。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
47 lines
1.5 KiB
Dart
47 lines
1.5 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
||
import 'package:kouyu_english/core/speech_compare.dart';
|
||
|
||
void main() {
|
||
test('a matching transcript ignores case, punctuation and contractions', () {
|
||
final result = compareSpoken(
|
||
'Sorry, please say that again. I like water.',
|
||
'sorry please say that again i like water',
|
||
);
|
||
expect(result.matches, isTrue);
|
||
expect(result.heardCount, result.total);
|
||
|
||
expect(
|
||
compareSpoken('I’m from Hong Kong.', 'I am from Hong Kong').matches,
|
||
isTrue,
|
||
);
|
||
expect(
|
||
compareSpoken('It’s three o’clock.', "it's three o'clock").matches,
|
||
isTrue,
|
||
);
|
||
});
|
||
|
||
test('marks the words that were not heard, keeping word order', () {
|
||
final result = compareSpoken('I like tea. Do you like tea?', 'I like tea');
|
||
expect(result.matches, isFalse);
|
||
expect(result.missedWords, ['Do', 'you', 'like', 'tea?']);
|
||
expect(result.close, isFalse);
|
||
|
||
final extra = compareSpoken('I like water.', 'I like water very much');
|
||
expect(extra.heardCount, extra.total);
|
||
expect(extra.extraWords, ['very', 'much']);
|
||
expect(extra.matches, isFalse);
|
||
});
|
||
|
||
test('digits and joined letters line up with the model sentence', () {
|
||
expect(
|
||
compareSpoken(
|
||
'My number is one-three-eight.',
|
||
'My number is 138',
|
||
).matches,
|
||
isTrue,
|
||
);
|
||
expect(compareSpoken('S H E N', 'Shen').matches, isTrue);
|
||
expect(compareSpoken('S H E N', 'S H E M').missedWords, ['N']);
|
||
});
|
||
}
|