Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#13 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1-3 小时
新手友好度
92/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp
领域
testing

调研方向

阅读 tests/Prompuff.Application.Tests/PromptTemplateServiceTests.cs 中的理论 Tokens_that_are_not_variables_are_ignored,并检查其中的用例如何断言 RenderSegments。添加列出的近似变量示例,并验证每个示例都将整个模板作为一个 Text 段返回。运行 dotnet test tests/Prompuff.Application.Tests;新用例通过且 src/ 下没有变更时即完成。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
C#
星标
0
派生
1
平均合并
1 小时 51 分钟
30 天内合并 PR
13

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hazeliscoding/prompuff 的其他 Issue

查看 hazeliscoding/prompuff 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。