بنقرة واحدة
add-ktnip-ksp-tests
// Adds tests for the ktnip KSP processor. Use when adding tests for a new collector, testing processor behavior with new annotations, or verifying KSP code generation for the telegram-bot library.
// Adds tests for the ktnip KSP processor. Use when adding tests for a new collector, testing processor behavior with new annotations, or verifying KSP code generation for the telegram-bot library.
Adds a new collector to the ktnip KSP processor. Use when implementing a new handler type (e.g. new annotation like @MyHandler), adding a collector for a new activity pattern, or extending the ktnip processor to collect additional annotated functions.
[Library contributor] Adds a new collector to the ktnip KSP processor. Use when implementing a new handler type (e.g. new annotation like @MyHandler), adding a collector for a new activity pattern, or extending the ktnip processor to collect additional annotated functions.
[Library contributor] Adds tests for the ktnip KSP processor. Use when adding tests for a new collector, testing processor behavior with new annotations, or verifying KSP code generation for the telegram-bot library.
Adds a new parameter resolution strategy to the ktnip KSP processor. Use when handler functions need to receive a new parameter type (e.g. ChatMember, InlineQuery), or when adding support for a new resolvable type in Activity invocation.
Adds a new Telegram Bot API method (action class and top-level functions). Use when implementing a new Telegram API endpoint, adding support for a specific method (e.g. sendVideoNote, getChatMemberCount), or creating a new action for the telegram-bot library.
Writes tests for Telegram Bot API actions. Use when adding tests for an API action, testing a new Telegram method, or when the user asks to add tests for the telegram-bot library.
| name | add-ktnip-ksp-tests |
| description | Adds tests for the ktnip KSP processor. Use when adding tests for a new collector, testing processor behavior with new annotations, or verifying KSP code generation for the telegram-bot library. |
ktnip/src/jvmTest/resources/test-data/FeatureName.kt (e.g. NewHandler.kt)@Test fun featureName() = runTest("test-data/FeatureName.kt")compile(vararg SourceFile, ...) instead of runTest for custom checksJvmCompilationResult; inspect exitCode, kspSourcesDir, generated filessymbolProcessors or processorProvidersexitCode == OK (or COMPILATION_ERROR when error directives present)/* G-EXPECT ... */ blocks for golden output checksTwo modes (hybrid):
test-data/golden/<TestName>/<FileName>.gold exists, full file content is compared./* G-EXPECT ... */ block in test data.G-EXPECT is optional when golden files exist — expectations are discovered from golden files automatically.
Update golden files: ./gradlew :ktnip:updateGolden — run when generated output changes intentionally.
Add /* G-EXPECT ... */ block to test data when no golden file exists:
/* G-EXPECT
file=KtGramCtxLoader.kt
contains="registerCommand"
contains="registerActivity"
file=BotCtx.kt
contains="userData"
contains="getState"
notContains="TODO"
noError
*/
Directives: file=, contains="...", notContains="...", matches="regex", notMatches="regex", noError, error contains=, error exact=, error count=, error file=X line=Y contains=