Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add acceptance tests that elaborate expected behaviour

Aperta
#129 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
cli, testing-qa

Direzione di ricerca

Esamina la gestione esistente delle funzionalità e dei flag dell’utility insieme a Cargo.toml, quindi riproduci il caso di newline di -F su Linux usando hostname::set(). Definisci test di accettazione per i flag e le funzionalità in sospeso descritti, includendo il comportamento previsto e se le discrepanze appartengono all’utility o alla dipendenza hostname.

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

Descrizione

While it is nice to have a reference point against which to check the utility's behaviour, it will still be immensely helpful to integrate certain acceptance tests for all features/flags (even the ones that are "todo"). Besides it will also determine scoping vis-a-vis say, the crate, hostname (0.4) that is currently a dependency.

Here's a case in point as far as librarr crate vs utility bin goes:

  • when attempting to introduce the "set" option, one way is to invoke the crate hostname(0.4)'s set call, i.e. hostname::set(), and also including the feature "set" in the Cargo.toml
  • for a file passed as input with -F, this basically means reading it in a buffer, calling trim() on it and then calling hostname::set() on it - at a very basic level
  • however, if one tests it on Linux boxes with a file input, for an input even with a newline say

test name 1
t e s t name

it (hostname::set() ) still sets the name as is i.e. with the new lines and a total of 3 lines of the hostname. This is very different from how the usual Linux/Mac hostname utility behaves - question is, who owns the discrepancy and its fixing - the utility or the crate?

  • now, it is unclear whether this will be called out as a bug in the utility or needs to be escalated as a bug in the dependency crate named hostname

Other cases might arise too; therefore, it will be great to articulate all the reqs as test cases

Lingua principale
Rust
Stelle
34
Fork
15
Merge medio
5h 44m
PR unite (30g)
6

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 uutils/hostname

Tutte le issue di uutils/hostname

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.