fix: harden school imports and add optional feedback diagnostics
This commit is contained in:
@@ -9,6 +9,21 @@ import 'package:hepan_everyday/data/schedule_file_import.dart';
|
||||
import 'package:hepan_everyday/domain/school_identity.dart';
|
||||
|
||||
void main() {
|
||||
test('unrecognized activity writes and incomplete declarations reject the entire timetable', () {
|
||||
const valid =
|
||||
'activity = new TaskActivity("T", "教师", "C", "课程(C.01)", "R", "教室", "010"); '
|
||||
'index = 0*unitCount+0; table0.activities[index][table0.activities[index].length]=activity;';
|
||||
for (final extra in [
|
||||
'table0.activities[11][table0.activities[11].length]=activity;',
|
||||
'activity = new TaskActivity("T", "教师", "C", "另一课程(C.02)", "R", "教室", "010")\n'
|
||||
'index = 0*unitCount+1; table0.activities[index][table0.activities[index].length]=activity;',
|
||||
]) {
|
||||
expect(
|
||||
() => parseActivityData('$valid $extra', unitCount: 12),
|
||||
throwsFormatException,
|
||||
);
|
||||
}
|
||||
});
|
||||
final uri = Uri.parse(
|
||||
'https://eams.uestc.edu.cn/eams/courseTableForStd.action',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user