rspec testsuite fails with ruby4.0.0dev 2025-11-24

Aperta
#63 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
ruby
Ambito
testing-qa

Direzione di ricerca

Esegui la suite RSpec con la modifica referenziata di Ruby 4.0.0dev ed esamina spec/compliance_spec.rb, spec/implicit_conversion_spec.rb e spec/compliance/identifiers.json. Traccia i dati UTF-8 malformati segnalati da JSON::GeneratorError, quindi verifica che l'intera suite di test venga caricata e superata senza rimuovere il fixture identifiers.

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

Descrizione

Beginning with this ruby4.0.0dev commit:
https://github.com/ruby/ruby/commit/c7a84ae0bb8c6dab3463076d7e5ca9b6f89880f4

(Or for ruby/json: beginning with this commit:
https://github.com/ruby/json/commit/4f4551f993bf1642eb8e0a18152306c5b25b18ea
)

jmespath git head ( https://github.com/jmespath/jmespath.rb/commit/5e86ea7da2e954cc12f5b3a8383a43c0a65acba7 )
rspec testsuite fails like:

An error occurred while loading ./spec/compliance_spec.rb.
Failure/Error:
          describe("Given #{scenario['given'].to_json}") do
            scenario['cases'].each do |test_case|
              if test_case['error']
  
                it "the expression #{test_case['expression'].inspect} raises a #{test_case['error']} error" do
                  error_class = case test_case['error']
                                when 'runtime' then JMESPath::Errors::RuntimeError
                                when 'syntax' then JMESPath::Errors::SyntaxError
                                when 'invalid-type' then JMESPath::Errors::InvalidTypeError
                                when 'invalid-value' then JMESPath::Errors::InvalidValueError

JSON::GeneratorError:
  source sequence is illegal/malformed utf-8
# ./spec/compliance_spec.rb:12:in 'JSON::Ext::Generator::GeneratorMethods::Hash#to_json'
# ./spec/compliance_spec.rb:12:in 'block (4 levels) in <top (required)>'
# ./spec/compliance_spec.rb:11:in 'Array#each'
# ./spec/compliance_spec.rb:11:in 'block (3 levels) in <top (required)>'
# ./spec/compliance_spec.rb:10:in 'block (2 levels) in <top (required)>'
# ./spec/compliance_spec.rb:5:in 'Array#each'
# ./spec/compliance_spec.rb:5:in 'block in <top (required)>'
# ./spec/compliance_spec.rb:4:in '<top (required)>'

An error occurred while loading ./spec/implicit_conversion_spec.rb.
Failure/Error:
              describe("Given #{scenario['given'].to_json}") do
                scenario['cases'].each do |test_case|
                  next if test_case['error']
                  it "searching #{test_case['expression'].inspect} returns #{test_case['result'].to_json}" do
                    result = JMESPath.search(test_case['expression'], Wrapper.wrap(scenario['given']))
  
                    expect(JMESPath::Util.as_json(result)).to eq(test_case['result'])
                  end
                end
              end

JSON::GeneratorError:
  source sequence is illegal/malformed utf-8
# ./spec/implicit_conversion_spec.rb:65:in 'JSON::Ext::Generator::GeneratorMethods::Hash#to_json'
# ./spec/implicit_conversion_spec.rb:65:in 'block (5 levels) in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:64:in 'Array#each'
# ./spec/implicit_conversion_spec.rb:64:in 'block (4 levels) in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:63:in 'block (3 levels) in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:58:in 'Array#each'
# ./spec/implicit_conversion_spec.rb:58:in 'block (2 levels) in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:57:in 'block in <module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:37:in '<module:JMESPath>'
# ./spec/implicit_conversion_spec.rb:36:in '<top (required)>'


Finished in 0.00007 seconds (files took 0.5614 seconds to load)
0 examples, 0 failures, 2 errors occurred outside of examples

spec/compliance/identifiers.json is failing (if I remove this json file, rspec testsuite passes).

Lingua principale
Ruby
Stelle
167
Fork
45
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 jmespath/jmespath.rb

Tutte le issue di jmespath/jmespath.rb

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.