Add drawing canvas (canvas module, DrawingView, drawing_* tests) and levels 13-14 (classes, saved patterns)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
denis
2026-10-16 17:40:53 +02:00
parent 4689d25700
commit d3b7c611f1
46 changed files with 1250 additions and 22 deletions
+4
View File
@@ -4,6 +4,7 @@
// les textes affichés viennent des catalogues (clé `lint.<code>`), jamais d'ici.
import { Validator } from '../lib/json-schema/index.js';
import { checkDrawing } from './drawingTests.js';
import { ValidationEngine } from './ValidationEngine.js';
const DRAFT = '2020-12';
@@ -227,6 +228,9 @@ export class LevelLinter {
if (test.kind === 'var_type_is' && !PYTHON_TYPES.includes(test.value)) {
add('warning', 'type_unusual', [...here, 'value'], { allowed: PYTHON_TYPES.join(', ') });
}
if (test.kind.startsWith('drawing_') && typeof test.value === 'string' && test.value !== '' && checkDrawing(test, []) === 'invalid_test') {
add('error', 'drawing_value_invalid', [...here, 'value']);
}
if (test.kind === 'stdout_matches_regex' && typeof test.value === 'string') {
try {
new RegExp(test.value);