fix(anatomy): R5.4 authored backticks refused, underscores paired across code spans refused; sweep cites probe_ref and probe_ref_
This commit is contained in:
1 parent
aff3a96d55
commit
bc5d0ad038
7 files changed
+91
-29
No files matched your search
@@ -113,6 +113,11 @@ const PATTERNS = [
|
||||
'中文',
|
||||
'مرحبا',
|
||||
'e\u0301',
|
||||
'Mesure a_b `c_`',
|
||||
'Champ snake_case, voir x_y fin',
|
||||
'to_do',
|
||||
'voir [a `](b)` c',
|
||||
'voir https://x.org/`<a`',
|
||||
'a * b',
|
||||
'*',
|
||||
'_',
|
||||
@@ -180,7 +185,7 @@ function probes(): string[] {
|
||||
return [...CHARACTERS.flatMap(positions), ...PATTERNS, ...randomProbes(400)]
|
||||
}
|
||||
|
||||
function changesFile(probe: string) {
|
||||
function changesFile(probe: string, referenceId: string) {
|
||||
return {
|
||||
changes: [
|
||||
{
|
||||
@@ -197,7 +202,7 @@ function changesFile(probe: string) {
|
||||
target: 'document',
|
||||
field: 'references',
|
||||
value: {
|
||||
id: 'probe-ref',
|
||||
id: referenceId,
|
||||
type: 'web',
|
||||
citation: `Citation ${probe}`,
|
||||
url: null,
|
||||
@@ -207,7 +212,7 @@ function changesFile(probe: string) {
|
||||
{
|
||||
op: 'cite',
|
||||
target: 'finding:hip/hip-dysfunctions/mobility',
|
||||
reference_ids: ['probe-ref'],
|
||||
reference_ids: [referenceId],
|
||||
},
|
||||
{
|
||||
op: 'set',
|
||||
@@ -227,8 +232,8 @@ function changesFile(probe: string) {
|
||||
}
|
||||
}
|
||||
|
||||
async function run(probe: string) {
|
||||
const file = changesFile(probe)
|
||||
async function run(probe: string, referenceId = 'probe_ref') {
|
||||
const file = changesFile(probe, referenceId)
|
||||
const changeset = ChangesetSchema.parse(file)
|
||||
const baseline = miniSheet()
|
||||
const result = applyChangeset(baseline, MINI_REFERENCES, changeset)
|
||||
@@ -252,6 +257,7 @@ async function run(probe: string) {
|
||||
})
|
||||
return {
|
||||
probe,
|
||||
reference_id: referenceId,
|
||||
changes_file: file,
|
||||
changelog_raw_sha256: sha256(changelogRaw),
|
||||
changelog_sha256: sha256(await formatMarkdown(changelogRaw)),
|
||||
@@ -264,6 +270,9 @@ describe('R5.4 Markdown sweep oracle', () => {
|
||||
it('markdown-sweep.json', async () => {
|
||||
const rows = []
|
||||
for (const probe of probes()) rows.push(await run(probe))
|
||||
// A cited id ending with `_` puts a closing underscore in a generated code span.
|
||||
for (const probe of ['to_do', 'a_b c', 'x'])
|
||||
rows.push(await run(probe, 'probe_ref_'))
|
||||
const oracle = {
|
||||
baseline: miniSheet(),
|
||||
references: MINI_REFERENCES,
|
||||
|
||||
Reference in new issue
Block a user