antcolony
All repositories: gitoria
1.2 KB
// antcolony#24: the check's rulings on report questions — run: bin/hybriel tests/questions-test.hl (prints none/ok/eff/kept/packed lines)import { validateVerdict, decide, filterQuestions } from '../lib/controller.hl'let base = { ticket = 'a#1' session = 's' verdict = 'pass' findings = [] summary = 'ok' }let r = { questions = [{ title = 'a' text = 'A?' } { title = 'b' text = 'B?' } { title = 'c' text = 'C?' } { title = 'd' text = 'D?' }] decided = ['x'] }console.log('none: ' + JSON.stringify(validateVerdict(base, 'a#1', 's', 4)))let v = { ticket = 'a#1' session = 's' verdict = 'pass' findings = [] summary = 'ok' questions = [{ index = 0 ruling = 'ask' reason = 'r' } { index = 1 ruling = 'decided' reason = 'r' answer = 'Use X.' } { index = 2 ruling = 'trivial' reason = 'r' } { index = 3 ruling = 'ask' reason = 'r' }] }console.log('missing answer: ' + JSON.stringify(validateVerdict(v, 'a#1', 's', 4)))v.questions[2].answer = 'Pick Y.'console.log('ok: ' + JSON.stringify(validateVerdict(v, 'a#1', 's', 4)))console.log('eff: ' + JSON.stringify(decide(v).verdict))let f = filterQuestions(r, v)console.log('kept: ' + f.questions.length + ' decided: ' + JSON.stringify(f.decided))v.questions[3].ruling = 'packed'console.log('packed: ' + decide(v).verdict + ' ' + decide(v).overruled)
Branches
- mainmain branch
Latest commits
- a6af7883tracker: worker box sees calendar.worldapi.org (login to copy)mre
- c613d26btemplates: bridges to external components (login.js for ident's selector) are allowed (creator 2026-09-27)mre
- 9062978ctracker: worker box sees /media/STORAGE/projects/old-tracker read-only (tracker#2 source data)mre
- 7f9660eeState of 2026-09-27, before the move to gitoriamre