Register validated commands without registry copies
This commit is contained in:
@@ -159,6 +159,12 @@ func TestRegisterBatchIsAtomicAndRejectsReservedPaths(t *testing.T) {
|
||||
if _, exists := app.commands["added"]; exists {
|
||||
t.Fatal("failed batch attached a partial registration")
|
||||
}
|
||||
if err := app.Register(added, added); err == nil {
|
||||
t.Fatal("Register accepted a duplicate within a batch")
|
||||
}
|
||||
if _, exists := app.commands["added"]; exists {
|
||||
t.Fatal("failed duplicate batch attached a registration")
|
||||
}
|
||||
for _, name := range []string{"help", "version"} {
|
||||
reserved, err := NewCommand(CommandSpec[struct{}]{Name: name})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user