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

Đang mở Phù hợp với người mới
#1,343 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript, yaml
Lĩnh vực
documentation, testing

Hướng nghiên cứu

Assertion đang lỗi nằm trong ts-packages/annotated-qmd/test/content-provenance.test.ts khoảng dòng 138, đọc mã nguồn thô từ fixtures/yaml-block-scalar.qmd bằng các offset byte lấy từ fixtures/yaml-block-scalar.json. Trước tiên, hãy chạy git ls-files --eol trên fixture và kiểm tra xem nó có được checkout dưới dạng CRLF trên Windows hay không. Cách sửa có khả năng nhất là mở rộng ghim eol=lf trong .gitattributes sang ts-packages/annotated-qmd/test/fixtures/*, rồi xác nhận test chạy đạt trên windows-latest.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Rust
Star
316
Fork
23
Merge trung bình
8 giờ 19 phút
Pull request đã merge (30 ngày)
244

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quarto-dev/q2

Tất cả issue của quarto-dev/q2

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.