cargo mutants: missed mutants in vortex-session

Aperta Adatta ai principianti
#12,633 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
testing-qa

Direzione di ricerca

Leggi vortex-session/src/registry.rs nelle vicinanze di Id::index, poi esamina gli artefatti di mutazione collegati per vedere quali usi dell’indice restituito sopravvivono. Aggiungi o modifica test che falliscano quando index() restituisce il valore sbagliato, quindi esegui di nuovo cargo mutants -f vortex-session/src/registry.rs -F ':53:9:'; il lavoro è concluso quando entrambi i mutanti segnalati vengono uccisi.

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

Descrizione

The nightly run at fdb9507c04e2939724aa39c298653a8ea3fd3b49 found 2 mutants in vortex-session that survive the tests. They are in code that changed during the last day.

Artifacts:

vortex-session/src/registry.rs:53:9

replace Id::index -> usize with 0

--- vortex-session/src/registry.rs
+++ replace Id::index -> usize with 0
@@ -45,17 +45,17 @@
 
     /// Returns the id's index in the global interner.
     ///
     /// Ids are interned densely from zero, so the index can address a `Vec` with one slot per id.
     /// An implementation detail of session registries, not part of the public API.
     #[doc(hidden)]
     #[inline]
     pub fn index(&self) -> usize {
-        self.0.into_usize()
+        0 /* ~ changed by cargo-mutants ~ */
     }
 
     /// Returns the interned string.
     pub fn as_str(&self) -> &str {
         let s = INTERNER.resolve(&self.0);
         // SAFETY: INTERNER is 'static and its arena is append-only, so resolved string
         // pointers are stable for the lifetime of the program.
         unsafe { &*(s as *const str) }
cargo mutants -f vortex-session/src/registry.rs -F ':53:9:'
vortex-session/src/registry.rs:53:9

replace Id::index -> usize with 1

--- vortex-session/src/registry.rs
+++ replace Id::index -> usize with 1
@@ -45,17 +45,17 @@
 
     /// Returns the id's index in the global interner.
     ///
     /// Ids are interned densely from zero, so the index can address a `Vec` with one slot per id.
     /// An implementation detail of session registries, not part of the public API.
     #[doc(hidden)]
     #[inline]
     pub fn index(&self) -> usize {
-        self.0.into_usize()
+        1 /* ~ changed by cargo-mutants ~ */
     }
 
     /// Returns the interned string.
     pub fn as_str(&self) -> &str {
         let s = INTERNER.resolve(&self.0);
         // SAFETY: INTERNER is 'static and its arena is append-only, so resolved string
         // pointers are stable for the lifetime of the program.
         unsafe { &*(s as *const str) }
cargo mutants -f vortex-session/src/registry.rs -F ':53:9:'
Lingua principale
Rust
Stelle
3.2k
Fork
239
Merge medio
1g 4h
PR unite (30g)
684

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 vortex-data/vortex

Tutte le issue di vortex-data/vortex

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.