import XCTest
@testable import Physarum
final class ParamHelpTests: XCTestCase {
func testEveryDescriptorHasNonEmptyTooltip() {
for d in ParamRegistry.all {
XCTAssertFalse(d.tooltip.isEmpty, "\(d.idKey) (label '\(d.label)') has no tooltip — add it to ParamHelp.byLabel")
}
}
func testKnownLabelsMapToText() {
XCTAssertTrue(ParamHelp.text(for: "Move speed").contains("step each frame"))
XCTAssertTrue(ParamHelp.text(for: "Agents").contains("particles"))
XCTAssertTrue(ParamHelp.text(for: "Decay").contains("survives"))
}
func testMatrixLabelGetsSharedText() {
XCTAssertTrue(ParamHelp.text(for: "M[1,2]").contains("attracts"))
XCTAssertEqual(ParamHelp.text(for: "M[0,0]"), ParamHelp.text(for: "M[2,1]"))
}
func testUnknownLabelIsEmpty() {
XCTAssertEqual(ParamHelp.text(for: "Nonexistent"), "")
}
func testNonScalarKeysHaveHelp() {
for key in ["Spawn pattern", "Blend mode", "Background color", "Species color",
"Audio reactive", "Auto-gain", "Input gain"] {
XCTAssertFalse(ParamHelp.text(for: key).isEmpty, "missing help for \(key)")
}
}
func testBlendModeMentionsAdditiveAndPaint() {
let t = ParamHelp.text(for: "Blend mode")
XCTAssertTrue(t.contains("Additive")); XCTAssertTrue(t.contains("Paint"))
}
}