sqlparser: add tests to improve coverage

This commit is contained in:
Sugu Sougoumarane 2015-08-04 14:32:01 -07:00
Родитель f9824de263
Коммит bd0e43c139
2 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -82,7 +82,9 @@ select /* is not null */ 1 from t where a is not null
select /* < */ 1 from t where a < b
select /* <= */ 1 from t where a <= b
select /* >= */ 1 from t where a >= b
select /* <> */ 1 from t where a != b
select /* > */ 1 from t where a > b
select /* != */ 1 from t where a != b
select /* <> */ 1 from t where a <> b#select /* <> */ 1 from t where a != b
select /* <=> */ 1 from t where a <=> b
select /* != */ 1 from t where a != b
select /* single value expre list */ 1 from t where a in (b)

Просмотреть файл

@ -94,3 +94,15 @@ func TestLimits(t *testing.T) {
t.Errorf("got %v, want %s", err, wantErr)
}
}
func TestIsAggregate(t *testing.T) {
f := FuncExpr{Name: "avg"}
if !f.IsAggregate() {
t.Error("IsAggregate: false, want true")
}
f = FuncExpr{Name: "foo"}
if f.IsAggregate() {
t.Error("IsAggregate: true, want false")
}
}