fix: import unpublished exam rooms and add opt-in school HTML feedback
This commit is contained in:
@@ -9,6 +9,27 @@ import 'package:hepan_everyday/data/schedule_file_import.dart';
|
||||
import 'package:hepan_everyday/domain/school_identity.dart';
|
||||
|
||||
void main() {
|
||||
test('missing course fields identify the failing field without disclosing values', () {
|
||||
const base =
|
||||
'new TaskActivity("T", "教师", "C", "课程(C.01)", "R", "教室", "010"); '
|
||||
'index=0*unitCount+0;table0.activities[index][table0.activities[index].length]=activity;';
|
||||
for (final entry in {
|
||||
'teacher_missing': base.replaceFirst('"教师"', '""'),
|
||||
'room_missing': base.replaceFirst('"教室"', '""'),
|
||||
'course_sequence_invalid': base.replaceFirst('课程(C.01)', '课程'),
|
||||
}.entries) {
|
||||
expect(
|
||||
() => parseActivityData(entry.value, unitCount: 12),
|
||||
throwsA(
|
||||
isA<UndergraduateActivityException>().having(
|
||||
(e) => e.code,
|
||||
'reason',
|
||||
entry.key,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
test('unrecognized activity writes and incomplete declarations reject the entire timetable', () {
|
||||
const valid =
|
||||
'activity = new TaskActivity("T", "教师", "C", "课程(C.01)", "R", "教室", "010"); '
|
||||
|
||||
Reference in New Issue
Block a user