testing

Project rules for organizing and naming tests in a C++ search engine. They distinguish integration tests, which check larger parts of the system together, from unit tests, which check smaller components, and specify their directories and filenames.

In plain words
What is it for?
Use them when adding shell integration tests or C++ unit tests for areas such as the crawler, storage, scoring, web server, or search core.
Why use it?
They make tests easier to find and keep testing organized by feature or component. Consistent names also make the test suite easier to maintain.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/hatefsystems/search-engine-core/testing
Clone the repo
git clone --depth 1 https://github.com/hatefsystems/search-engine-core

Made for: Cursor.

Per session 2,248 This file is loaded in full into every session.
When invoked 2,248 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02248 $0.02248
Opus 5 $0.01124 $0.01124
Sonnet 5 $0.00450 $0.00450
Haiku 4.5 $0.00225 $0.00225

Measured yesterday against content hash 19c4f30f1188, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

response=$(curl -s -X POST "$API_URL/api/endpoint" \
.cursor/rules/testing.mdc · 389 lines

How it starts

The opening of the file, as written. The whole thing — 389 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Standards and Organization

Test Directory Structure

tests/
├── integration/           # Integration tests (API, end-to-end)
│   ├── README.md
│   ├── test_profile_api.sh
│   ├── test_link_blocks.sh
│   ├── test_website_profile_api.sh
│   └── test_10_concurrent.sh
├── common/               # C++ unit tests for common utilities
├── crawler/              # C++ unit tests for crawler
├── models/               # C++ unit tests for models
├── privacy/              # C++ unit tests for privacy/encryption
├── scoring/              # C++ unit tests for scoring
├── search_core/          # C++ unit tests for search engine core
├── storage/              # C++ unit tests for storage layer
├── text_processing/      # C++ unit tests for text processing
└── webserver/           # C++ unit tests for webserver

scripts/                  # Utility scripts (not tests)

Test File Naming

Shell Integration Tests

  • Format: test_<feature_name>.sh
  • Location: tests/integration/
  • Examples:
    • test_profile_api.sh - Profile CRUD operations
    • test_link_blocks.sh - Link blocks and analytics
    • test_10_concurrent.sh - Concurrent request handling

C++ Unit Tests

  • Format: test_<component>.cpp
  • Location: tests/<component>/
  • Examples:
    • tests/storage/test_profile_storage.cpp
    • tests/crawler/test_url_parser.cpp

Shell Test Script Standards

Required Structure

#!/bin/bash
set -e  # Exit on error

# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'

# Configuration
API_URL="${API_BASE_URL:-http://localhost:3000}"

echo "Testing Feature Name..."

# Test functions
test_feature_creation() {
    echo "Test: Create feature..."
    # ... test implementation
    echo -e "${GREEN}✅ Feature creation successful${NC}"
}

# Run tests
test_feature_creation
# ... more tests

# Cleanup
cleanup() {
    echo "Cleaning up test data..."
    # ... cleanup implementation
}
trap cleanup EXIT

echo "All tests passed!"

Read the full file on GitHub · 389 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 389 lines · 2,248 tokens per session scan A 19c4f30f1188

Subscribe to this mod's changes

testing is a cursor rule published in the GitHub repository hatefsystems/search-engine-core (5 stars, last pushed 28d ago), licensed Apache-2.0. It adds 2,248 tokens to every session, about $0.0112 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.