CR-1a: ee[-] Parser-Fix (Silvain) — lookbehind trennt e[-] vom führenden Allel
normalizeToken: lookbehind-Regex /(?<=[A-Za-z])e\[-\]/→'?' greift wenn e[-] von einem Buchstaben (erstes Allel) gefolgt wird (ee[-] → e?); standalone e[-] fällt durch auf die generische \[-\]→? Regel (→ e?). Beide Pfade liefern splitToken 2 Allele [e,?]. Vorher: ee[-]→ee?→ 3 Allele → Fehler. Fixture: Silvain 'aa c[chm]c[chm] Dd ee[-] Gg Pp Spsp' → E=[e,?] ✓. Gate: build ✓ eslint ✓ vitest 92/92 ✓ e2e 126/126 ✓
This commit is contained in:
@@ -602,12 +602,21 @@ describe('GEN-3h: breeder bracket-notation display + E-locus e-before-ef order',
|
||||
)
|
||||
})
|
||||
|
||||
it('[-] bracket-unknown parses as wildcard (e[-] → E=[e,?], displays e-)', () => {
|
||||
// NOTE: oracle for Silvain shows "ee[-]" which contains 3 E-allele tokens
|
||||
// (e + e + [-]) and cannot be parsed. Flagged to god — see done-report.
|
||||
// This test documents what [e,?] at E produces: "e-".
|
||||
it('e[-] standalone: parses as [e,?], displays e-', () => {
|
||||
const g = fromDisplayString('aa CC DD e[-] GG PP spsp rere')
|
||||
expect(g.E).toEqual(['e', '?'])
|
||||
expect(toDisplayString(g)).toBe('aa CC DD e- GG PP spsp rere')
|
||||
})
|
||||
|
||||
it('CR-1a: Silvain oracle ee[-] parses without crash → [e,?], displays e-', () => {
|
||||
// Real herdbook notation: ee[-] = fox allele e + unknown e-type second allele.
|
||||
// The lookbehind rule strips the second e[-] → '?', leaving 'e?' for splitToken.
|
||||
const input = 'aa c[chm]c[chm] Dd ee[-] Gg Pp Spsp'
|
||||
const g = fromDisplayString(input)
|
||||
expect(g.E).toEqual(['e', '?'])
|
||||
expect(g.C).toEqual(['cchm', 'cchm'])
|
||||
expect(g.D).toEqual(['D', 'd'])
|
||||
expect(g.Sp).toEqual(['Sp', 'sp'])
|
||||
expect(toDisplayString(g)).toBe('aa c[chm]c[chm] Dd e- Gg Pp Spsp rere')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user