Skip to content

Commit

Permalink
fix: missing newline
Browse files Browse the repository at this point in the history
  • Loading branch information
kycheng committed Jan 18, 2023
1 parent 2c25279 commit d7b352c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions command/options/exit_code_option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package options

import (
"strings"
"testing"

. "github.com/onsi/gomega"
Expand All @@ -40,7 +41,7 @@ func TestExitCodeOption(t *testing.T) {
g.Expect(err).Should(Succeed(), "parse flag succeed.")
success, code, err := obj.Succeed()
g.Expect(err).To(Succeed())
g.Expect(code).To(Equal("0"))
g.Expect(strings.TrimRight(code, "\n")).To(Equal("0"))
g.Expect(success).To(Equal(true))
})

Expand Down Expand Up @@ -98,7 +99,7 @@ func TestExitCodeOption(t *testing.T) {
g.Expect(err).Should(Succeed(), "parse flag succeed.")
success, code, err := obj.Succeed()
g.Expect(err).To(Succeed())
g.Expect(code).To(Equal("-1"))
g.Expect(strings.TrimRight(code, "\n")).To(Equal("-1"))
g.Expect(success).To(Equal(false))
})

Expand All @@ -118,7 +119,7 @@ func TestExitCodeOption(t *testing.T) {
g.Expect(err).Should(Succeed(), "parse flag succeed.")
success, code, err := obj.Succeed()
g.Expect(err).To(Succeed())
g.Expect(code).To(Equal(""))
g.Expect(strings.TrimRight(code, "\n")).To(Equal(""))
g.Expect(success).To(Equal(true))
})
}
2 changes: 1 addition & 1 deletion command/options/testdata/exit-code-option-failed.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-1
-1
2 changes: 1 addition & 1 deletion command/options/testdata/exit-code-option-succeed.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0
0

0 comments on commit d7b352c

Please sign in to comment.