1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-12 08:23:48 +02:00

Semantics

This commit is contained in:
Laszlo Fogas 2019-06-05 10:11:01 +02:00
parent 435083db9e
commit 4323148a85
2 changed files with 3 additions and 4 deletions

View File

@ -40,9 +40,8 @@ func Parse(data []byte) ([]Axis, error) {
return nil, err
}
// if not a matrix build return an array with just the single axis.
if len(matrix) == 0 {
return nil, nil
return []Axis{}, nil
}
return calc(matrix), nil

View File

@ -25,10 +25,10 @@ func TestMatrix(t *testing.T) {
g.Assert(len(set)).Equal(24)
})
g.It("Should return nil if no matrix", func() {
g.It("Should return empty array if no matrix", func() {
axis, err := ParseString("")
g.Assert(err == nil).IsTrue()
g.Assert(axis == nil).IsTrue()
g.Assert(len(axis) == 0).IsTrue()
})
g.It("Should return included axis", func() {