forked from sourcenetwork/defradb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
277 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
tests/integration/query/inline_array/with_max_doc_id_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2024 Democratized Data Foundation | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package inline_array | ||
|
||
import ( | ||
"testing" | ||
|
||
testUtils "github.com/sourcenetwork/defradb/tests/integration" | ||
) | ||
|
||
// This test is meant to provide coverage of the planNode.Spans | ||
// func by targeting a specific docID in the parent select. | ||
func TestQueryInlineNillableFloatArray_WithDocIDAndMax_Succeeds(t *testing.T) { | ||
test := testUtils.TestCase{ | ||
Description: "Simple inline array with doc id, max of nillable float array", | ||
Actions: []any{ | ||
testUtils.CreateDoc{ | ||
Doc: `{ | ||
"name": "Shahzad", | ||
"pageRatings": [3.1425, 0.00000000001, 10, null] | ||
}`, | ||
}, | ||
testUtils.Request{ | ||
Request: `query { | ||
Users(docID: "bae-3f7e0f22-e253-53dd-b31b-df8b081292d9") { | ||
name | ||
_max(pageRatings: {}) | ||
} | ||
}`, | ||
Results: map[string]any{ | ||
"Users": []map[string]any{ | ||
{ | ||
"name": "Shahzad", | ||
"_max": float64(10), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
executeTestCase(t, test) | ||
} |
Oops, something went wrong.