Failing tests on Locale nb-no

Aperta
#4,372 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@OyvindLGjesdal ci sta già lavorando.

Dal 1/11/2026.

  • #4373 di @OyvindLGjesdal — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
1.5k
Fork
729
Merge medio
1g 8h
PR unite (30g)
56

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/jena

Tutte le issue di apache/jena

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.