// SPDX-FileCopyrightText: (C) Copyright 2026 Pim van Pelt // SPDX-License-Identifier: Apache-2.0 package main import ( "testing" cli "git.ipng.ch/ipng/golang-cli" ) // TestTreeValid keeps the example's command tree free of the authoring faults // Validate checks for. It doubles as the recommended way to use Validate: from // a unit test, so a malformed tree fails the build rather than misdispatching // at runtime. func TestTreeValid(t *testing.T) { if err := cli.Validate(buildTree()); err != nil { t.Fatalf("buildTree() has authoring faults:\n%v", err) } }