Files
w3cjandClaude Opus 5.5 4d863bb749 fix(cli): another part's name in --tools, --agents or --layers names the flag that takes it
The picker change's review:

- --tools claude, --layers node, --agents node and the like are refused
  with part_other_flag, which names the flag that takes the name, as in
  devvm --agents claude; a name no part has keeps unknown_part or its
  did-you-mean. checkPartFlag checks the three parts' names together.
  TestCheckFlagValue, up.txtar, up_checks.txtar and setup.txtar cover it.
- image.ToolName is back, with its TestValuePatterns row: ToolFile and
  ParseToolFile check a tool's name with it.
- internals/design.md's Docker layer checks name parts_flags_ignored for
  --layers docker on a VM that exists, as e2e checks, in place of a
  message that's gone.
- The home page and the README give the Claude Code token before
  claude's first start, the home page's list says which rows it shows
  checked, and the FAQ says the agents' config comes from your machine.
  The README says the first run asks for new VMs' size and agents before
  the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 06:47:59 -07:00

46 lines
1.0 KiB
Go

package image
import "testing"
// The value patterns other packages check names and keys with.
func TestValuePatterns(t *testing.T) {
for _, c := range []struct {
name string
f func(string) bool
ok []string
bad []string
}{
{
"IsKey", IsKey,
[]string{"0123456789ab", "abcdefabcdef"},
[]string{"", "0123456789a", "0123456789abc", "0123456789AB", "0123456789ag", "0123456789ab\n"},
},
{
"ToolName", ToolName,
[]string{"node", "python3", "claude"},
[]string{"", "Node", "3node", "node-x", "node_x", "nöde"},
},
{
"ToolVersion", ToolVersion,
[]string{"24.21.0", "1.2.3-rc.1", "v2", "1.0+build", "2024_01"},
[]string{"", "-1", ".1", "1 2", "1/2", "1;2", "1\n", "1'2", "$1"},
},
{
"FeatureName", FeatureName,
[]string{"omb", "cli-tools", "9x"},
[]string{"", "-x", "X", "a_b", "a.b"},
},
} {
for _, s := range c.ok {
if !c.f(s) {
t.Errorf("%s(%q) = false", c.name, s)
}
}
for _, s := range c.bad {
if c.f(s) {
t.Errorf("%s(%q) = true", c.name, s)
}
}
}
}