rs-parsepatch misses some diffs

Đang mở
#92 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
50/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python, rust
Lĩnh vực
tooling

Hướng nghiên cứu

Start by running the Python reproduction against rs_parsepatch.get_diffs with the supplied patch and confirm that it yields 2 instead of 3. Trace how get_diffs handles the two files and their hunks, then verify that the corrected behavior reports all 3 diffs.

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

Mô tả

Assuming that variable path is a patch defined in the following python code:

import rs_parsepatch

patch = """
--- a/js/src/vm/Printer.cpp	2023-06-20 15:04:32.907323769 +0000
+++ b/js/src/vm/Printer.cpp	2023-06-20 15:05:18.491323769 +0000
@@ -52,7 +52,7 @@
 }

 bool GenericPrinter::put(mozilla::Span<const char16_t> str) {
-  for (char16_t c: str) {
+  for (char16_t c : str) {
     if (!putChar(c)) {
       return false;
     }
@@ -245,7 +245,7 @@
     return false;
   }

-  for (char16_t c: str) {
+  for (char16_t c : str) {
     MOZ_ASSERT(IsAsciiPrintable(c));
     *bp++ = char(c);
   }

--- a/js/src/vm/BytecodeUtil.cpp	2023-06-20 15:04:32.907323769 +0000
+++ b/js/src/vm/BytecodeUtil.cpp	2023-06-20 15:05:18.439323769 +0000
@@ -2308,9 +2308,7 @@
   MOZ_CRASH("No binding");
 }

-UniqueChars ExpressionDecompiler::getOutput() {
-  return sprinter.release();
-}
+UniqueChars ExpressionDecompiler::getOutput() { return sprinter.release(); }

 }  // anonymous namespace



"""

diffs = 0
for diff in rs_parsepatch.get_diffs(patch):
    diffs += 1
print(diffs)

Expected behaviour would be to have printed out 3 but in this case we have 2, which is wrong.
This has been tested and reproduced on the latest version: 0.3.9

Ngôn ngữ chính
Rust
Star
8
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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 mozilla/pyo3-parsepatch

Tất cả issue của mozilla/pyo3-parsepatch

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.