Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaji-kharse authored and mangalaman93 committed Aug 19, 2024
1 parent 0066419 commit 4e7bada
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
22 changes: 10 additions & 12 deletions dgraph/cmd/alpha/upsert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1906,22 +1906,20 @@ func TestUpsertBulkUpdateValue(t *testing.T) {
// Resetting the val in upsert to check if the
// values are not switched and the interest is added
m1 := `
upsert {
query {
u as var(func: has(amount)) {
amt as amount
}
me () {
updated_amt as math(amt+1.123456789101112)
upsert {
query {
u as var(func: has(amount)) {
amt as amount
updated_amt as math(amt+1.123456789101112)
}
}
}
mutation {
set {
uid(u) <amount> val(updated_amt) .
mutation {
set {
uid(u) <amount> val(updated_amt) .
}
}
}
}
`

q1 := `
Expand Down
4 changes: 2 additions & 2 deletions query/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,11 +728,11 @@ func (ag *aggregator) matchType(left, right *types.Val) error {
case BIGFLOAT:
if rightType == FLOAT {
var bf big.Float
right.Value = bf.SetPrec(types.BigFloatPrecision).SetFloat64(right.Value.(float64))
right.Value = *bf.SetPrec(types.BigFloatPrecision).SetFloat64(right.Value.(float64))
right.Tid = types.BigFloatID
} else if rightType == INT {
var bf big.Float
right.Value = bf.SetPrec(types.BigFloatPrecision).SetInt64(right.Value.(int64))
right.Value = *bf.SetPrec(types.BigFloatPrecision).SetInt64(right.Value.(int64))
right.Tid = types.BigFloatID
}

Expand Down
4 changes: 2 additions & 2 deletions query/query4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestBigMathValue(t *testing.T) {
{
q(func: has(money)) {
f as money
g: math(f2)
g: math(f-2)
}
}`

Expand All @@ -90,7 +90,7 @@ func TestBigMathValue(t *testing.T) {
{
q(func: has(money)) {
f as money
g: math(f2)
g: math(f-2)
}
}`

Expand Down
4 changes: 2 additions & 2 deletions schema/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func TestSchema(t *testing.T) {
Predicate: x.GalaxyAttr("age"),
ValueType: pb.Posting_INT,
}},
{"amount", &pb.SchemaUpdate{
Predicate: "amount",
{x.GalaxyAttr("amount"), &pb.SchemaUpdate{
Predicate: x.GalaxyAttr("amount"),
ValueType: pb.Posting_BIGFLOAT,
}},
{x.GalaxyAttr("coordinates"), &pb.SchemaUpdate{
Expand Down

0 comments on commit 4e7bada

Please sign in to comment.