fix: harden school imports and add optional feedback diagnostics

This commit is contained in:
Codex
2026-10-15 10:37:32 +08:00
parent 674df1ceb3
commit 7299f4d8b6
25 changed files with 722 additions and 42 deletions
@@ -7,6 +7,17 @@ import 'package:hepan_everyday/domain/app_snapshot.dart';
import 'package:hepan_everyday/domain/course.dart';
void main() {
test(
'optional exam types reject invalid values even in graduate snapshots',
() {
final saved = ExamSchedule(
semesterLabel: '2026秋',
termId: '73',
records: [const ExamRecord(code: 'A', name: '课程', examTypeId: 99)],
).toJson();
expect(() => ExamSchedule.fromJson(saved), throwsFormatException);
},
);
test(
'managed undergraduate identifiers cannot lose their school or term',
() {