Skip to content

Commit a770efc

Browse files
committed
Fix CLI test after changing error message in previous commit.
Add Makefile. Update travis yaml.
1 parent 9f0c096 commit a770efc

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
sudo: false
22
language: go
3-
script: go test . ./cli ./dexec ./util
3+
go:
4+
- "1.12.x"
5+
env:
6+
- GO111MODULE=on

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.PHONY : all test
2+
3+
all: | test
4+
5+
test:
6+
@go test

cli_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ func TestUnknown(t *testing.T) {
2323
want WantedData
2424
}{
2525
{
26-
OptionData{"-bad", "Unknown option: -bad"},
27-
WantedData{None, "", 0, "Unknown option: -bad"},
26+
OptionData{"-bad", "unknown option: -bad"},
27+
WantedData{None, "", 0, "unknown option: -bad"},
2828
},
2929
}
3030
for _, c := range cases {
@@ -35,7 +35,7 @@ func TestUnknown(t *testing.T) {
3535
t.Errorf("ParseOsArgs %q != %q", gotOptionValue, c.want.value)
3636
} else if gotChomped != c.want.chomped {
3737
t.Errorf("ParseOsArgs %q != %q", gotChomped, c.want.chomped)
38-
} else if gotError.Error() != c.want.errorMessage {
38+
} else if gotError != nil && gotError.Error() != c.want.errorMessage {
3939
t.Errorf("ParseOsArgs %q != %q", gotError.Error(), c.want.errorMessage)
4040
}
4141
}

0 commit comments

Comments
 (0)