Add $type tests#691
Conversation
Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
…-tests Signed-off-by: PatersonProjects <keldonhoff@gmail.com>
danielfrankcom
left a comment
There was a problem hiding this comment.
Looks good, comments are minor.
|
|
||
| # Property [Core BSON Type Mapping]: each BSON type produces a specific, | ||
| # distinct type name string. | ||
| TYPE_CORE_BSON_TESTS: list[ExpressionTestCase] = [ |
There was a problem hiding this comment.
Not sure we need this given TYPE_STORED_FIELD_TESTS, the coverage is equivalent.
| TYPE_ARRAY_LITERAL_TESTS: list[ExpressionTestCase] = [ | ||
| ExpressionTestCase( | ||
| "array_single_element_literal_unwrap", | ||
| expression={"$type": ["hello"]}, |
There was a problem hiding this comment.
Would be good to also cover a case like {"$type": ["$val"]} given the array unwrapping is not consistent behavior across operators and combining it with field path resolution might do something weird.
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (1007+0 LOC, 7 files); LLM: Adds new test cases for the $type operator under the compatibility tests path, expanding test coverage for a specific MongoDB operator. If a label is wrong, remove it manually and ping |
This PR adds the tests for the $type operator. They were originally authored by @danielfrankcom.
Ref: Issue #15