Windows: annotated-qmd "Substring over Concat" test reads the source two characters early

Abierto Apto para principiantes
#1,343 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript, yaml

Línea de trabajo

La aserción que falla está en ts-packages/annotated-qmd/test/content-provenance.test.ts alrededor de la línea 138, y lee el código fuente sin procesar de fixtures/yaml-block-scalar.qmd usando desplazamientos de bytes de fixtures/yaml-block-scalar.json. Primero revisa git ls-files --eol en el fixture y si se descarga como CRLF en Windows. La solución probable es extender el fijado eol=lf en .gitattributes a ts-packages/annotated-qmd/test/fixtures/*, y luego confirmar que la prueba pasa en windows-latest.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug testing windows

The test "YAML block-scalar inlines: Substring over Concat maps through the parent, not affinely" fails on windows-latest:

https://github.com/quarto-dev/q2/actions/runs/45608700263

AssertionError [ERR_ASSERTION]: inline 0 (Str "line") raw source text
    actual: '  li',
    expected: 'line',

The test is here:

https://github.com/quarto-dev/q2/blob/49036fc2d6f8dfc4eeddb7b44f3ad69be313aad2/ts-packages/annotated-qmd/test/content-provenance.test.ts#L138

I think this is a CRLF checkout. fixtures/yaml-block-scalar.json records byte offsets into fixtures/yaml-block-scalar.qmd, and .gitattributes only pins ts-packages/annotated-qmd/examples/* to eol=lf, not test/fixtures. On my Windows checkout git ls-files --eol reports i/lf w/crlf for the .qmd. Two extra bytes in the front matter (---\r\ntitle: |\r\n) shift the read window by 2, which matches ' li' against 'line'. I haven't tried the fixture with LF endings yet.

We could extend the existing pin to ts-packages/annotated-qmd/test/fixtures/*. Linux and macOS pass today.

Related: the existing pin and its comment in .gitattributes, and #1275 (the opt-in Windows runner axis that exposed this).

Lenguaje dominante
Rust
Estrellas
316
Forks
23
Merge medio
8 h 19 min
PR fusionados (30 d)
244

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quarto-dev/q2

Todos los issues de quarto-dev/q2

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.