gitoriaLog in with ident

antcolony

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit9062978c9062978ctracker: worker box sees /media/STORAGE/projects/old-tracker read-only (tracker#2 source data)mre9062978c/tests/questions-test.hl

1.2 KB

  1. // antcolony#24: the check's rulings on report questions — run: bin/hybriel tests/questions-test.hl (prints none/ok/eff/kept/packed lines)
  2. import { validateVerdict, decide, filterQuestions } from '../lib/controller.hl'
  3. let base = { ticket = 'a#1' session = 's' verdict = 'pass' findings = [] summary = 'ok' }
  4. let r = { questions = [{ title = 'a' text = 'A?' } { title = 'b' text = 'B?' } { title = 'c' text = 'C?' } { title = 'd' text = 'D?' }] decided = ['x'] }
  5. console.log('none: ' + JSON.stringify(validateVerdict(base, 'a#1', 's', 4)))
  6. let v = { ticket = 'a#1' session = 's' verdict = 'pass' findings = [] summary = 'ok' questions = [
  7. { 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' }] }
  8. console.log('missing answer: ' + JSON.stringify(validateVerdict(v, 'a#1', 's', 4)))
  9. v.questions[2].answer = 'Pick Y.'
  10. console.log('ok: ' + JSON.stringify(validateVerdict(v, 'a#1', 's', 4)))
  11. console.log('eff: ' + JSON.stringify(decide(v).verdict))
  12. let f = filterQuestions(r, v)
  13. console.log('kept: ' + f.questions.length + ' decided: ' + JSON.stringify(f.decided))
  14. v.questions[3].ruling = 'packed'
  15. console.log('packed: ' + decide(v).verdict + ' ' + decide(v).overruled)

Branches

Latest commits

  • 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