From c1c8fea01d04bfda3d5348f3248f7b1d130e332b Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 2 Aug 2022 16:34:18 +0200 Subject: [PATCH] cmd/utils, test/system: Tweak an error message for consistency Barring the first line, all other lines are terminated with a full stop elsewhere. https://github.com/containers/toolbox/issues/937 --- src/cmd/utils.go | 2 +- test/system/101-create.bats | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/utils.go b/src/cmd/utils.go index eff0c8546..3dd663c8e 100644 --- a/src/cmd/utils.go +++ b/src/cmd/utils.go @@ -74,7 +74,7 @@ func createErrorContainerNotFound(container string) error { func createErrorInvalidContainer(containerArg string) error { var builder strings.Builder fmt.Fprintf(&builder, "invalid argument for '%s'\n", containerArg) - fmt.Fprintf(&builder, "Container names must match '%s'\n", utils.ContainerNameRegexp) + fmt.Fprintf(&builder, "Container names must match '%s'.\n", utils.ContainerNameRegexp) fmt.Fprintf(&builder, "Run '%s --help' for usage.", executableBase) errMsg := builder.String() diff --git a/test/system/101-create.bats b/test/system/101-create.bats index 76733d9c8..d52f02808 100644 --- a/test/system/101-create.bats +++ b/test/system/101-create.bats @@ -43,7 +43,7 @@ teardown() { assert_failure assert_line --index 0 "Error: invalid argument for 'CONTAINER'" - assert_line --index 1 "Container names must match '[a-zA-Z0-9][a-zA-Z0-9_.-]*'" + assert_line --index 1 "Container names must match '[a-zA-Z0-9][a-zA-Z0-9_.-]*'." assert_line --index 2 "Run 'toolbox --help' for usage." } @@ -52,7 +52,7 @@ teardown() { assert_failure assert_line --index 0 "Error: invalid argument for '--container'" - assert_line --index 1 "Container names must match '[a-zA-Z0-9][a-zA-Z0-9_.-]*'" + assert_line --index 1 "Container names must match '[a-zA-Z0-9][a-zA-Z0-9_.-]*'." assert_line --index 2 "Run 'toolbox --help' for usage." }