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

Test that `{{name|x}}` and other near-variables stay plain text

Aperta Adatta ai principianti
#13 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à
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
92/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
testing

Direzione di ricerca

Leggi la teoria Tokens_that_are_not_variables_are_ignored in tests/Prompuff.Application.Tests/PromptTemplateServiceTests.cs e controlla come i suoi casi verificano RenderSegments. Aggiungi gli esempi elencati che somigliano a variabili e verifica che ciascuno restituisca l’intero modello come un unico segmento Text. Esegui dotnet test tests/Prompuff.Application.Tests; il lavoro è completo quando i nuovi casi passano senza modifiche sotto src/.

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

Descrizione

good first issue

ROADMAP.md decided that variable defaults and choice lists, if they come, go in a metadata key and not inside the braces, and that a body holding {{name|x}} renders as plain text in 1.0 and must keep doing so. No test pins that yet, so a change to the variable pattern could start treating these as variables without anything failing.

What to do

Add cases to the Tokens_that_are_not_variables_are_ignored theory for at least:

  • {{name|x}} and {{ name | x }}
  • {{name:default}}
  • a line break inside the braces, such as "{{\nname\n}}"
  • a name with a non-ASCII letter, such as {{café}}

For each case, also check that RenderSegments returns the whole template as one Text segment. Don't change PromptTemplateService: these already render as written, so the tests pass as soon as they're added.

Where to look

  • src/Prompuff.Application/Services/PromptTemplateService.cs: the VariableToken pattern (line 14).
  • tests/Prompuff.Application.Tests/PromptTemplateServiceTests.cs: the theory at line 58.
  • ROADMAP.md: "Decisions: market research (2026-10-10)", the bullet on variables gaining options without new syntax.

Done when

  • The new cases are in the theory and pass.
  • Each case also checks RenderSegments.
  • 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.