MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / TestBigFloatSort

Function TestBigFloatSort

query/query4_test.go:1665–1688  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1663}
1664
1665func TestBigFloatSort(t *testing.T) {
1666 s1 := testSchema + "\n amount: bigfloat @index(bigfloat) .\n"
1667
1668 setSchema(s1)
1669 triples := `
1670 <0x666> <amount> "100" .
1671 <0x124> <amount> "99.1231231233" .
1672 <0x777> <amount> "99" .
1673 <0x888> <amount> "99.0000000000000000000001" .
1674 <0x123> <amount> "123123.123123123132" .
1675 `
1676 addTriplesToCluster(triples)
1677
1678 q1 := `
1679 {
1680 me(func: has(amount), orderasc: amount) {
1681 uid
1682 }
1683 }`
1684 js := processQueryNoErr(t, q1)
1685 expectedRes := `{"data":{"me":[{"uid":"0x777"},{"uid":"0x888"}` +
1686 `,{"uid":"0x124"},{"uid":"0x666"},{"uid":"0x123"}]}}`
1687 require.JSONEq(t, js, expectedRes)
1688}
1689
1690func TestBigFloatMax(t *testing.T) {
1691 s1 := testSchema + "\n amount: bigfloat @index(bigfloat) .\n"

Callers

nothing calls this directly

Calls 3

setSchemaFunction · 0.70
addTriplesToClusterFunction · 0.70
processQueryNoErrFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…