Skip to content

Add string operator $indexOfBytes/$indexOfCP/$strLenBytes/$strLenCP and integration tests#81

Open
eerxuan wants to merge 2 commits intodocumentdb:mainfrom
eerxuan:upstream-remaining-string-tests
Open

Add string operator $indexOfBytes/$indexOfCP/$strLenBytes/$strLenCP and integration tests#81
eerxuan wants to merge 2 commits intodocumentdb:mainfrom
eerxuan:upstream-remaining-string-tests

Conversation

@eerxuan
Copy link
Copy Markdown
Collaborator

@eerxuan eerxuan commented Apr 10, 2026

Add compatibility tests for $indexOfBytes, $indexOfCP, $strLenBytes, $strLenCP operators and string combination integration tests.

Ref: #10

Tests cover:

  • Search behavior and encoding (byte vs code point)
  • Index types and bounds
  • Byte counts and code point counts
  • Type errors and invalid arguments
  • Null/missing handling
  • Size limits
  • Invariants and input forms
  • String operator combinations (integration tests)

788 tests total.

danielfrankcom and others added 2 commits April 9, 2026 17:06
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
- Add __init__.py for package resolution
- Add INDEXOF*, STRLEN*, EXPRESSION_ARITY_ERROR, FAILED_TO_PARSE_ERROR, INVALID_DOLLAR_FIELD_PATH, BSON_TO_STRING_CONVERSION_ERROR, STRING_SIZE_LIMIT_ERROR to error_codes.py
- Add STRING_SIZE_LIMIT_BYTES to test_constants.py
- Fix pytest_params import (parametrize module)
- Use relative imports for operator common utils
- Pin CI MongoDB to 8.2.4
- Run isort/black formatting

Signed-off-by: Yunxuan Shi <yunxuan@amazon.com>
@eerxuan eerxuan requested a review from a team as a code owner April 10, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants