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

Cover LineDiff's CRLF, removal-only and large-diff branches

Aperta Adatta ai principianti
#14 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
90/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
testing

Direzione di ricerca

Leggi src/Prompuff.Application/Services/LineDiff.cs nella parte relativa al fallback e a SplitLines, quindi aggiungi i tre test dei rami a tests/Prompuff.Application.Tests/LineDiffTests.cs. Esegui dotnet test tests/Prompuff.Application.Tests. Il lavoro è completato quando i casi CRLF, testo nullo e fallback di 2.001 righe verificano i conteggi, i tipi, l’ordine e i numeri di riga specificati per le modifiche.

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

Descrizione

good first issue

The History tab's diff comes from LineDiff. Its tests cover additions, edits and identical texts, but three branches have no test:

  • SplitLines turns \r\n into \n, so a body with Windows line endings and the same body with LF endings should show no changes.
  • When the new text is empty or null, every old line is Removed.
  • When the changed middle is bigger than MaxTableCells (4,000,000 cells, so more than about 2,000 lines on each side), it skips the LCS table and lists every old line as removed, then every new line as added.

What to do

Add a test for each branch to LineDiffTests. For the large one, build two texts of 2,001 lines that share no line, such as a0…a2000 and b0…b2000, and check kinds, order and line numbers, not only the counts. Tests only; don't change LineDiff.

Where to look

  • src/Prompuff.Application/Services/LineDiff.cs: the fallback at line 58, SplitLines at line 117.
  • tests/Prompuff.Application.Tests/LineDiffTests.cs.

Done when

  • "a\r\nb" against "a\nb" gives only Unchanged lines, and CountChanges is (0, 0).
  • CountChanges("a\nb", null) is (0, 2), and Compute marks both lines Removed with old line numbers 1 and 2.
  • The large-diff test checks that all 2,001 Removed lines come before the 2,001 Added lines, with the right line numbers.
  • Nothing under src/ changes.

Testing it

dotnet test tests/Prompuff.Application.Tests
Lingua principale
C#
Stelle
0
Fork
1
Merge medio
1h 51m
PR unite (30g)
13

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 hazeliscoding/prompuff

Tutte le issue di hazeliscoding/prompuff

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.