Failing tests on Locale nb-no

Đang mở
#4,372 1 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

@OyvindLGjesdal đang làm issue này rồi.

Từ ngày 1/11/2026.

  • #4373 của @OyvindLGjesdal — đang mở

Đá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
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java

Hướng nghiên cứu

Start with the failing tests exprSprintf_07, exprSprintf_08 and exprSprintf_10 in the TestFunctions class, and run them under the nb-NO locale to reproduce the comma-versus-dot mismatch. Then check how the afn:sprintf implementation formats numbers, and confirm with the maintainer whether it should follow the system locale or stay locale-independent. Done means the tests pass under nb-NO and the chosen behaviour is documented.

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

Mô tả

bug
Version

6.3-SNAPSHOT

What happened?

b8c1fe4ad80b5d0a88bdc540a423b84996205c42 introduced failing tests when building on my laptop.

It has tests that fails on the nb-NO locale.

As far as I understand this is just the tests and the function itself uses the Root locale and stays persistent.

There is a companion PR that replaces the printf values that uses the current locale and replace them with the expected value.

I add a new test where I change the locale temporarily to see that afn:sprintf still returns the same value.

from the docs:

afn:sprintf(format, v1, v2, ...) | Make a string from the format string and the RDF terms.

Not sure if the function should be Locale independent or not, since it also doesn't have an equivalent xpath function afaik.

Does this look correct @afs or is it supposed to change with system locale?

Relevant output and stacktrace
[INFO] 
[ERROR] Failures: 
[ERROR]   TestFunctions.exprSprintf_07:82->test:285 expected: <"this number is equal to 11,22"> but was: <"this number is equal to 11.22">
[ERROR]   TestFunctions.exprSprintf_08:83->test:285 expected: <"1,235"> but was: <"1.235">
[ERROR]   TestFunctions.exprSprintf_10:85->test:285 expected: <"this number is equal to 1,23457"> but was: <"this number is equal to 1.23457">
[INFO] 
[ERROR] Tests run: 16788, Failures: 3, Errors: 0, Skipped: 12
[INFO]
Are you interested in making a pull request?

Yes

Ngôn ngữ chính
Java
Star
1.5k
Fork
733
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
56

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 apache/jena

Tất cả issue của apache/jena

Issue tương tự

Thêm issue về Java

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.