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

オープン 初心者向け
#1,343 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript, yaml

調査の方向性

失敗しているアサーションは ts-packages/annotated-qmd/test/content-provenance.test.ts の138行目付近にあります。このテストは fixtures/yaml-block-scalar.json のバイトオフセットを使って fixtures/yaml-block-scalar.qmd から生のソースを読み込みます。まず、フィクスチャに対して git ls-files --eol を実行し、Windows で CRLF としてチェックアウトされていないかを確認してください。考えられる修正は、.gitattributes の eol=lf 指定を ts-packages/annotated-qmd/test/fixtures/* まで広げることです。その後、windows-latest でテストが通ることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
Rust
スター
316
フォーク
23
平均マージ
8時間 19分
マージ済み PR(30日)
244

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。