vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood 2018-06-17 17:59:12 +01:00
parent 3f0789e2db
commit 08021c4636
2474 changed files with 435818 additions and 282709 deletions

View file

@ -488,7 +488,10 @@ func (e Expression) returnExpression(expressionType expressionType) *string {
if e.expressionMap == nil {
return nil
}
return aws.String(e.expressionMap[expressionType])
if s, exists := e.expressionMap[expressionType]; exists {
return &s
}
return nil
}
// exprNode are the generic nodes that represents both Operands and

View file

@ -978,6 +978,39 @@ func TestBuildExpressionString(t *testing.T) {
}
}
func TestReturnExpression(t *testing.T) {
cases := []struct {
name string
input Expression
expected *string
}{
{
name: "projection exists",
input: Expression{
expressionMap: map[expressionType]string{
projection: "#0, #1, #2",
},
},
expected: aws.String("#0, #1, #2"),
},
{
name: "projection not exists",
input: Expression{
expressionMap: map[expressionType]string{},
},
expected: nil,
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
actual := c.input.returnExpression(projection)
if e, a := c.expected, actual; !reflect.DeepEqual(a, e) {
t.Errorf("expect %v, got %v", e, a)
}
})
}
}
func TestAliasValue(t *testing.T) {
cases := []struct {
name string