Need specs for each_with_index + Enumerable method interaction
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Esamina le specifiche esistenti di Enumerable e gli output di esempio dell’issue per le interazioni di each_with_index con to_h, uniq e zip. Riproduci i casi tra diverse implementazioni, quindi determina dove devono rientrare queste interazioni e quale comportamento dovrebbero richiedere le specifiche. Il lavoro è completato quando tutti e tre i casi sono coperti e il comportamento previsto è stato definito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
There are at least three cases from jruby/jruby#8345 where an interaction between an each_with_index Enumerator and an Enumerable method was or is broken in JRuby:
- to_h
- uniq
- zip
Of these, we've fixed uniq and I have a fix in process for to_h but I'm not sure where to put specs for this kind of interaction.
My first thought was in Enumerable specs, since that's where I had to fix things, but I have not come up with a reproduction that doesn't use an each_with_index enumerator. All cases should be specified, though only a few exhibited this differing behavior between CRuby and JRuby.
Running the same example script against TruffleRuby shows similar issues, so I think getting these cases spec'ed would benefit all impls:
$ diff truffleruby_enum_args.txt ruby_enum_args.txt
1c1
< truffleruby 24.2.1, like ruby 3.3.7, Oracle GraalVM Native [arm64-darwin20]
---
> ruby 3.3.3 (2024-06-12 revision f1c7b6f435) [arm64-darwin23]
25c25
< filter_map [[1, 2], 0]
---
> filter_map [1, 2]
65c65
< to_h [[1, 2], 0]
---
> to_h [1, 2]
67c67
< uniq [[1, 2], 0]
---
> uniq [1, 2]
70c70
< zip [[[1, 2], 0]]
---
> zip [[1, 2], 0]
It's also possible CRuby is wrong to have special behavior for these methods.
- Lingua principale
- Ruby
- Stelle
- 622
- Fork
- 402
- Merge medio
- 14h 51m
- PR unite (30g)
- 6
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ruby/spec
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
-
Improving Marshal specs Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Hacktoberfest help wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
rubocop/rubocop-rspec#2236 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
riscv/riscv-unified-db#2624 · 1 reazione ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100