Install
$ agentstack add skill-jimmc414-claude-code-plugin-marketplace-test-with-examples ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
test-with-examples
When to Use
- Clear, discrete input/output relationships
- Examples serve as specification
- Teaching or documenting behavior
- Regression testing
When NOT to Use
- Behavior too complex for examples
- Need property-based testing
- Examples would be exhaustive
The Pattern
Write tests as lists of (input, expected_output) pairs.
# Test cases as data
tests = [
(input1, expected1),
(input2, expected2),
(input3, expected3),
]
def run_tests(func, tests):
"""Run function on test cases."""
for inp, expected in tests:
result = func(inp)
assert result == expected, f"{func.__name__}({inp}) = {result}, expected {expected}"
print(f"All {len(tests)} tests pass.")
Example (from pytudes)
# lispytest.py - comprehensive test examples
lis_tests = [
("(quote (testing 1 (2.0) -3.14e159))", ['testing', 1, [2.0], -3.14e159]),
("(+ 2 2)", 4),
("(+ (* 2 100) (* 1 10))", 210),
("(if (> 6 5) (+ 1 1) (+ 2 2))", 2),
("(if (< 6 5) (+ 1 1) (+ 2 2))", 4),
("(define x 3)", None),
("x", 3),
("(+ x x)", 6),
("((lambda (x) (+ x x)) 5)", 10),
("(define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1))))))", None),
("(fact 10)", 3628800),
("(fact 50)", 30414093201713378043612608166064768844377641568960512000000000000),
]
# DocstringFixpoint.ipynb - rainfall tests
def test_rainfall():
assert 0/2 == rainfall([0, 0]), "no rain"
assert 5/1 == rainfall([5]), "one day"
assert 6/3 == rainfall([1, 2, 3]), "mean of several days"
assert 6/4 == rainfall([0, 1, 2, 3]), "non-integer mean"
assert 9/3 == rainfall([1, 2, -9, -100, 6]), "negative values ignored"
assert 7/5 == rainfall([1, 0, 2, 0, 4]), "zeros not ignored"
assert 8/3 == rainfall([1, 2, 5, -999, 404]), "values after -999 ignored"
return True
# Cryptarithmetic.ipynb - solver test examples
for solver in (solve, faster_solve):
assert "1 + 2 = 3" in set(solver("A + B = C"))
assert not set(solver("A + B = CDE")) # No solution
assert set(solver("A * B = CA")) == {
'5 * 3 = 15', '5 * 7 = 35', '4 * 6 = 24',
'8 * 6 = 48', '2 * 6 = 12', '5 * 9 = 45'
}
Key Principles
- Examples as spec: Tests define expected behavior
- Comments explain: Brief note on what each tests
- Cover edge cases: Empty, zero, negative, boundary
- Expected first or last: Consistent (input, expected) order
- Readable assertions:
assert result == expected, message
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: jimmc414
- Source: jimmc414/claude-code-plugin-marketplace
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.