Fix Issue #202: Add $bitAnd operator expression compatibility tests#662
Fix Issue #202: Add $bitAnd operator expression compatibility tests#662krishnasai453 wants to merge 7 commits into
Conversation
…/github.com/krishnasai453/functional-tests into fix-issue-202-add_bitAnd_compatibility_test
|
Hi @ this is my first contribution to this project. I've fixed issue #202 by correcting the additional compatibility tests for the |
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (126+0 LOC, 2 files); LLM failed: Invalid response body while trying to fetch https://api.anthropic.com/v1/messages: Premature close If a label is wrong, remove it manually and ping |
Description
This PR resolves failing compatibility tests for the
$bitAndoperator intest_expression_bitAnd_additional.py.Why this is needed
Under MongoDB and DocumentDB specifications, the
$bitAndaggregation operator only supportsintandlongoperands. Passing an array expression (such as[["$a", "$b"], 3]) or an object expression (such as[{"x": "$a", "y": "$b"}, 0]) evaluates to array/object structures, which are non-numeric types. These operations should fail with a type mismatch rather than succeed.What changed
ARRAY_EXPRESSION_TESTSandOBJECT_EXPRESSION_TESTSintest_expression_bitAnd_additional.pyto expectTYPE_MISMATCH_ERROR(code14) instead of assuming successful evaluation.error_codeparameter toassert_expression_resultintest_bitAnd_expression_additional.test_expression_bitAnd_testing_strategy.txt.How to test
Run the bitwise operator tests locally: