cangjie-unittest

Create and execute unit tests for Cangjie language code.

1|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/SunriseSummer/CangjieDocValidator --skill cangjie-unittest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-unittest
Source: https://github.com/SunriseSummer/CangjieDocValidator/tree/main/.github/skills/unittest
Command: npx skills add https://github.com/SunriseSummer/CangjieDocValidator --skill cangjie-unittest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive framework for writing and running unit tests for Cangjie language code, ensuring code quality and reliability.

Core Features & Use Cases

  • Test Definition: Supports defining tests using @Test functions and @TestCase methods within classes.
  • Assertions: Offers a rich set of assertion macros like @Assert, @Expect, @AssertThrows, and @PowerAssert for various validation needs.
  • Mocking & Verification: Includes a powerful mocking framework with @On for stubbing and Verify for checking interactions.
  • Use Case: Developers can use this Skill to write tests for their Cangjie functions, classes, and modules, verifying expected behavior and catching regressions early in the development cycle.

Quick Start

Use cjpm test to run all unit tests in your Cangjie project.

Frequently Asked Questions about cangjie-unittest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write and run unit tests for Cangjie language code?

The Cangjie testing framework supports mocking to isolate dependencies in unit tests. You can use the `@On` macro for stubbing interactions and the `Verify` mechanism to check behavior, ensuring components are tested in isolation.

What assertions are available for validating expected outcomes in Cangjie tests?

Cangjie tests provide a rich set of assertion macros for validating expected outcomes, including `@Assert`, `@Expect`, `@AssertThrows` for exception checking, and `@PowerAssert` to generate detailed diagnostic messages upon failure.

Can I perform mocking and dependency isolation in Cangjie unit tests?

The Cangjie testing framework supports mocking to isolate dependencies in unit tests. You can use the `@On` macro for stubbing interactions and the `Verify` mechanism to check behavior, ensuring components are tested in isolation.

Does the Cangjie testing framework support parameterized tests and benchmarks?

Yes, the Cangjie testing framework supports parameterized tests for running the same logic against multiple inputs, dynamic test generation, and benchmarks to measure and verify the performance of your Cangjie language code.

How do I manage the test lifecycle when testing Cangjie modules?

You can manage the test lifecycle for Cangjie modules by defining `@TestCase` classes. This structure allows you to organize setup, teardown, and individual test methods, ensuring your test environment is correctly initialized and cleaned up.